'use strict';
game.import('character', function (lib, game, ui, get, ai, _status) {
	return {
		name: 'standard',
		connect: true,
		characterSort: {
			standard: {
				standard_shu: ["liubei", "guanyu", "zhangfei", "zhaoyun", "zhugeliang", "young_zhugeliang", "weiyan", "jiangwei", "huangyueying", "ganfuren", "wuxian"],
				standard_wei: ["caocao", "zhangliao", "guojia", "xiahoudun", "zhonghui", "xuhuang", "xunyou", "caiwenji", "zhenji", "bianfuren"],
				standard_wu: ["sunquan", "zhouyu", "huanggai", "ganning", "lusu", "lvmeng", "luxun", "sunshangxiang", "daqiao", "xiaoqiao"],
				standard_qun: ['zhangjiao', 'lvbu', 'liru', 'gongsunzan', 'huatuo'],
				standard_jin: ['zuofen'],
				standard_funny:['dabao'],
			},
		},
		character: {
			//shu
			liubei: ['male', 'shu', 4, ['rende', 'hanzhi', 'jijiang'], ['zhu'],1,['Dfuzhu','Dfangyu']],
			guanyu: ['male', 'shu', 5, ['tuodao', 'yijue'], null,2,['Dshuchu','Dhuifu']],
			zhangfei: ['male', 'shu', 4, ['paoxiao', 'haoyin'], null,1,['Dshuchu']],
			zhaoyun: ['male', 'shu', 4, ['longdan'], null,2,['Dshuchu','Dfangyu']],
			zhugeliang: ['male', 'shu', 3, ['guanxing', 'kanpo', 'kongcheng'], null,3,['Dkongchang','Dfangyu']],
			young_zhugeliang: ['male', 'shu', 3, ['mouji', 'kanpo', 'bazhen'], null,3,['Dkongchang','Dfangyu']],
			weiyan: ['male', 'shu', 4, ['kuanggu', 'qimou'], null,3,['Dshuchu','Dhuifu']],
			jiangwei: ['male', 'shu', 4, ['tiaoxin', 'zhiji'], null,4,['Dkongchang','Dfangyu']],
			huangyueying: ['female', 'shu', 3, ['jizhi', 'qicai'], null,3,['Dshuchu','Dkongchang']],
			ganfuren: ['female', 'shu', 3, ['shushen', 'shenzhi'], null,2,['Dhuifu']],
			wuxian: ['female', 'shu', 3, ['fumian', 'daiyan'], null,4,['Dfuzhu']],

			//wei
			caocao: ['male', 'wei', 4, ['jianxiong', 'hujia'], ['zhu'],2,['Dfangyu']],
			zhangliao: ['male', 'wei', 4, ['tuxi'], null,1,['Dkongchang']],
			guojia: ['male', 'wei', 3, ['tiandu', 'yiji'], null,3,['Dshuchu','Dkongchang']],
			xiahoudun: ['male', 'wei', 6, ['ganglie'], null,1,['Dfangyu']],
			zhonghui: ['male', 'wei', 4, ['quanji', 'zili'], null,3,['Dshuchu','Dfangyu']],
			xuhuang: ['male', 'wei', 4, ['duanliang', 'jiezi'], null,2,['Dkongchang']],
			xunyou: ['male', 'wei', 3, ['qice', 'zhiyu'], null,3,['Dshuchu','Dfangyu']],
			caiwenji: ['female', 'wei', 3, ['chenqing', 'moshi'], null,4,['Dhuifu','Dshuchu']],
			zhenji: ['female', 'wei', 3, ['qingguo', 'luoshen'], null,2,['Dshuchu','Dfangyu']],
			bianfuren: ['female', 'wei', 3, ['yishi', 'yuejian'], null,2,['Dfuzhu']],

			//wu
			sunquan: ['male', 'wu', 4, ['zhiheng', 'jiuyuan'], ['zhu'],3,['Dshuchu']],
			zhouyu: ['male', 'wu', 3, ['yingzi', 'huoji', 'fanjian'], null,3,['Dshuchu','Dkongchang']],
			huanggai: ['male', 'wu', 5, ['kurou', 'zhaxiang'], null,1,['Dshuchu']],
			ganning: ['male', 'wu', 4, ['xiying'], null,2,['Dkongchang']],
			lusu: ['male', 'wu', 3, ['haoshi', 'dimeng'], null,4,['Dkongchang','Dfuzhu']],
			lvmeng: ['male', 'wu', 4, ['keji', 'qinxue'], null,2,['Dfangyu']],
			luxun: ['male', 'wu', 3, ['qianxun', 'lianying'], null,4,['Dfuzhu']],
			sunshangxiang: ['female', 'wu', 4, ['jianying','gongzhi', 'xiaoji'], null,2,['Dshuchu']],
			daqiao: ['female', 'wu', 3, ['guose', 'yayun', 'shenghua'], null,3,['Dkongchang','Dhuifu']],
			xiaoqiao: ['female', 'wu', 3, ['tianxiang', 'hongyan', 'piaoling'], null,3,['Dfangyu','Dfuzhu']],

			//qun
			zhangjiao: ['male', 'qun', 3, ['leiji', 'guidao', 'huangtian'], ['zhu'],3,['Dshuchu','Dkongchang']],
			lvbu: ['male', 'qun', 5, ['wushuang', 'yongzhan'], null,1,['Dshuchu']],
			liru: ['male', 'qun', 3, ['dumou', 'mieji'], null,3,['Dshuchu','Dkongchang']],
			gongsunzan: ['male', 'qun', 4, ['yicong'], null,2,['Dfangyu']],
			huatuo: ['male', 'qun', 3, ['jijiu', 'qingnang'], null,2,['Dhuifu']],
			//	chengong: ['male', 'qun', 3, ['mingce', 'zhichi']],

			//jin
			zuofen: ['female', 'jin', 3, ['zhaosong', 'lisi'],null,2,['Dfuzhu']],

			dabao:['male','wu',4,['repojun']],
		},
		characterIntro: {
			liubei: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			guanyu: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			zhangfei: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			zhugeliang: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			young_zhugeliang: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			weiyan: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			zhaoyun: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			jiangwei: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			huangyueying: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			ganfuren: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			wuxian: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			sunquan: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			ganning: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			lvmeng: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			lusu: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			huanggai: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			zhouyu: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			daqiao: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			xiaoqiao: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			luxun: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			sunshangxiang: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			caocao: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			xunyou: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			bianfuren: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			zhonghui: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			caiwenji: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			xuhuang: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			xiahoudun: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			zhangliao: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			guojia: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			zhenji: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			liru: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			zhangjiao: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			huatuo: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			lvbu: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			gongsunzan: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			chengong: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',
			zuofen: '<li>立绘：三国杀官方<br><li>配音：三国杀官方',

			dabao:'<li>立绘：三国杀官方<br><li>配音：三国杀官方',
		},
		card: {
			fushou: {
				fullskin: true,
				vanish: true,
				derivation: 'wuxian',
				type: 'delay',
				forceDie: true,
				judge: function (card) {
					if (get.suit(card) != 'spade') return 1;
					return -2;
				},
				judge2: function (result) {
					if (result.bool == false) return false;
					return true;
				},
				effect: function () {
					'step 0'
					if (result.bool == true) {
						player.chooseToGuanxing(2);
					}
					else event.finish();
					'step 1'
					player.draw(2);
				},
				loseDelay: false,
				ai: {
					basic: {
						value: 7.2,
					},
					tag: {
						draw: 2,
					}
				}
			},
		},
		skill: {
			rende: {
				audio: 2,
				enable: 'phaseUse',
				usable: 1,
				locked:false,
				filterCard: true,
				selectCard: [1, Infinity],
		//		derivation: ['jingde'],
				discard: false,
				lose: false,
				delay: 0,
				filterTarget: function (card, player, target) {
					return player != target;
				},

				check: function (card) {
					if (ui.selected.cards.length > 1) return 0;
					if (ui.selected.cards.length && ui.selected.cards[0].name == 'du') return 0;
					if (!ui.selected.cards.length && card.name == 'du') return 20;
					var player = get.owner(card);
					var num = 0;
					var evt2 = _status.event.getParent();
					var num = 0;
					player.getHistory('lose', function (evt) {
						if (evt.getParent().skill == 'rende' && evt.getParent(3) == evt2) num += evt.cards.length;
					});
					if (player.hp == player.maxHp || num > 1 || player.countCards('h') <= 1) {
						if (ui.selected.cards.length) {
							return -1;
						}
						var players = game.filterPlayer();
						for (var i = 0; i < players.length; i++) {
							if (players[i].hasSkill('haoshi') &&
								!players[i].isTurnedOver() &&
								!players[i].hasJudge('lebu') &&
								get.attitude(player, players[i]) >= 3 &&
								get.attitude(players[i], player) >= 3) {
								return 11 - get.value(card);
							}
						}
						if (player.countCards('h') > player.hp) return 10 - get.value(card);
						if (player.countCards('h') > 2) return 6 - get.value(card);
						return -1;
					}
					return 10 - get.value(card);
				},
			//	group: 'rende2',
				content: function () {
					player.addTempSkill('rende_clear', { player: 'phaseBegin' });
					target.gain(cards, player, 'giveAuto').gaintag.add('rende');
			//		target.addAdditionalSkill('rende_' + player.playerid, 'jingde');
				},
				ai: {
					order: function (skill, player) {
						if (player.hp < player.maxHp && player.countCards('h') > 1) {
							return 10;
						}
						return 1;
					},
					result: {
						target: function (player, target) {
							if (target.hasSkillTag('nogain')) return 0;
							if (ui.selected.cards.length && ui.selected.cards[0].name == 'du') {
								if (target.hasSkillTag('nodu')) return 0;
								return -10;
							}
							if (target.hasJudge('lebu')) return 0;
							var nh = target.countCards('h');
							var np = player.countCards('h');
							if (player.hp == player.maxHp || player.countCards('h') <= 1) {
								if (nh >= np - 1 && np <= player.hp && !target.hasSkill('haoshi')) return 0;
							}
							return Math.max(1, 5 - nh);
						}
					},
					effect: {
						target: function (card, player, target) {
							if (player == target && get.type(card) == 'equip') {
								if (player.countCards('e', { subtype: get.subtype(card) })) {
									var players = game.filterPlayer();
									for (var i = 0; i < players.length; i++) {
										if (players[i] != player && get.attitude(player, players[i]) > 0) {
											return 0;
										}
									}
								}
							}
						}
					},
					threaten: 0.8
				},
				subSkill: {
					clear: {
						onremove: function (player) {
							game.countPlayer(function (current) {
								current.removeAdditionalSkill('rende_' + player.playerid);
							});
						},
					},
				}
			},
			/*rende2: {
				forced: true,
				popup: false,
				trigger: { player: 'phaseBegin' },
				content: function () {
					for (var i = 0; i < game.players.length; i++)
						if (game.players[i].hasSkill('jingde')) game.players[i].removeSkill('jingde');
				}
			},
			jingde: {
				forced: true,
				preHidden: true,
				audio: 2,
				trigger: { source: 'damageBegin2' },
				filter: function (event, player) {
					return event.player.hasSkill('rende');
				},
				content: function () {
					"step 0"
					var eff = get.damageEffect(player, trigger.player, player, trigger.nature);
					player.chooseCardTarget({
						selectCard: 1,
						filterTarget: function (card, player, target) {
							return target.hasSkill('rende');
						},
						prompt: '将一张牌交给刘备，否则防止此伤害。',
					}).set('ai1', function (card) {
						if (_status.event.eff > 0) {
							return 7 - get.value(card);
						}
						return 0;
					}).set('ai2', function (target) {
						if (_status.event.eff > 0)
							return true;
						else
							return false;
					}).set('eff', eff);
					"step 1"
					if (result.targets && result.targets[0]) {
						player.lose(result.cards, ui.discardPile, 'visible');
						result.targets[0].gain(result.cards, player, 'giveAuto');
					}
					else trigger.cancel();
				},
				mod: {
					ignoredHandcard: function (card, player) {
						if (card.hasGaintag('rende')) {
							return true;
						}
					},
					cardDiscardable: function (card, player, name) {
						if (name == 'phaseDiscard' && card.hasGaintag('rende')) {
							return false;
						}
					},
				},
				onremove: function (player) {
					player.removeGaintag('rende');
				},
				ai: {
					effect: {
						target: function (card, player, target) {
							if (get.attitude(player, target) < 0) {
								if (_status.event.name == 'rende') return;
								var bs = player.getCards('h');
								if (bs.length < 2) return 0;
								if (bs.length <= 3) {
									for (var i = 0; i < bs.length; i++) {
										if (get.value(bs[i]) < 5) {
											return [1, 0, 1, -0.5];
										}
									}
									return 0;
								}
								return [1, 0, 1, -0.5];
							}
						}
					}
				}
			},*/
			hanzhi: {
				audio: 2,
				audioname: ['jiangwei'],
				forced: true,
				locked:true,
				trigger: { player: 'phaseUseEnd' },
				filter:function(event,player){
					return player.isMinHp()||player.isMinHandcard();
				},
				content: function () {
					var num=0;
					if(player.isMinHp()) num++;
					if(player.isMinHandcard()) num++;
					player.draw(num);
				},
			},
			jijiang: {
				audio: 2,
				unique: true,
				group: ['jijiang1'],
				zhuSkill: true,
				filter: function (event, player) {
					if (!player.hasZhuSkill('jijiang') || !game.hasPlayer(function (current) {
						return current != player && current.group == 'shu';
					})) return false;
					return !event.jijiang && (event.type != 'phase' || !player.hasSkill('jijiang3'));
				},
				enable: ['chooseToUse', 'chooseToRespond'],
				viewAs: { name: 'sha' },
				filterCard: function () { return false },
				selectCard: -1,
				ai: {
					order: function () {
						return get.order({ name: 'sha' }) + 0.3;
					},
					respondSha: true,
					skillTagFilter: function (player) {
						if (!player.hasZhuSkill('jijiang') || !game.hasPlayer(function (current) {
							return current != player && current.group == 'shu';
						})) return false;
					},
				},
			},
			jijiang1: {
				audio: 2,
				trigger: { player: ['useCardBegin', 'respondBegin'] },
				logTarget: 'targets',
				filter: function (event, player) {
					return event.skill == 'jijiang';
				},
				forced: true,
				content: function () {
					"step 0"
					delete trigger.skill;
					trigger.getParent().set('jijiang', true);
					"step 1"
					if (event.current == undefined) event.current = player.next;
					if (event.current == player) {
						player.addTempSkill('jijiang3');
						event.finish();
						trigger.cancel();
						trigger.getParent().goto(0);
					}
					else if (event.current.group == 'shu') {
						var next = event.current.chooseToRespond('是否替' + get.translation(player) + '打出一张杀？', { name: 'sha' });
						next.set('ai', function () {
							var event = _status.event;
							return (get.attitude(event.player, event.source) - 2);
						});
						next.set('source', player);
						next.set('jijiang', true);
						next.set('skillwarn', '替' + get.translation(player) + '打出一张杀');
						next.noOrdering = true;
						next.autochoose = lib.filter.autoRespondSha;
					}
					else {
						event.current = event.current.next;
						event.redo();
					}
					"step 2"
					if (result.bool) {
						event.finish();
						trigger.card = result.card;
						trigger.cards = result.cards;
						trigger.throw = false;
						if (typeof event.current.ai.shown == 'number' && event.current.ai.shown < 0.95) {
							event.current.ai.shown += 0.3;
							if (event.current.ai.shown > 0.95) event.current.ai.shown = 0.95;
						}
					}
					else {
						event.current = event.current.next;
						event.goto(1);
					}
				}
			},
			jijiang3: {
				trigger: { global: ['useCardAfter', 'useSkillAfter', 'phaseAfter'] },
				silent: true,
				charlotte: true,
				filter: function (event) {
					return event.skill != 'jijiang';
				},
				content: function () {
					player.removeSkill('jijiang3');
				}
			},

			tuodao: {
				audio: 2,
				enable: ['chooseToUse'],
				locked:false,
				filterCard: function (card, player) {
					if (get.zhu(player, 'shouyue')) return true;
					return get.color(card) == 'red';
				},
				group: ['tuodao1', 'tuodao2'],
				position: 'hes',
				viewAs: { name: 'sha_delay' },
				viewAsFilter: function (player) {
					if (get.zhu(player, 'shouyue')) {
						if (!player.countCards('hes')) return false;
					}
					else {
						if (!player.countCards('hes', { color: 'red' })) return false;
					}
				},
				prompt: '将一张红色牌当杀延迟使用',
				check: function (card) { return 5 - get.value(card) },
				ai: {
					directHit_ai: true,
					skillTagFilter: function (player) {
						if (get.zhu(player, 'shouyue')) {
							if (!player.countCards('hes')) return false;
						}
						else {
							if (!player.countCards('hes', { color: 'red' })) return false;
						}
					},
				}
			},
			tuodao1: {
				audio: 'tuodao',
				enable: ['chooseToRespond'],
				filterCard: function (card, player) {
					if (get.zhu(player, 'shouyue')) return true;
					return get.color(card) == 'red';
				},
				position: 'hes',
				viewAs: { name: 'sha' },
				viewAsFilter: function (player) {
					if (get.zhu(player, 'shouyue')) {
						if (!player.countCards('hes')) return false;
					}
					else {
						if (!player.countCards('hes', { color: 'red' })) return false;
					}
				},
				prompt: '将一张红色牌当杀打出',
				check: function (card) { return 4 - get.value(card) },
				ai: {
					skillTagFilter: function (player) {
						if (get.zhu(player, 'shouyue')) {
							if (!player.countCards('hes')) return false;
						}
						else {
							if (!player.countCards('hes', { color: 'red' })) return false;
						}
					},
					respondSha: true,
				}
			},
			tuodao2: {
				audio: 'tuodao',
				forced: true,
				trigger: { player: 'useCardToPlayered' },
				filter: function (event, player) {
					console.log(event.card);
					if (event.card.storage == 'delay' || event.card.storage == 'delay_jiabu' || event.card.storage == 'delay_zhifang' || event.card.storage == 'delay_xiayu' || event.card.storage == 'delay_fengqing' || event.card.storage == 'delay_luanchuang')
						return true;
					return false;
				},
				content: function () {
					trigger.getParent().directHit.add(trigger.target);
				}
			},
			yijue: {
				audio: 2,
				locked:false,
				direct:true,
				trigger: { player: 'phaseEnd' },
				filter: function (event, player) {
					if (!game.hasPlayer(function (current) {
						if (player == current) return false;
						return current.hp != current.maxHp || current.countCards('j', { name: 'sha_delay' });
					})) return false;
					if (!player.storage.yijue) return true;
					return game.hasPlayer(function (current) {
						if (player == current) return false;
						return !player.storage.yijue.contains(current);
					});

				},
				init: function (player) {
					if (!player.storage.yijue) player.storage.yijue = [];
				},
				check: function (event, player) {
					if (!game.hasPlayer(function (current) {
						if (get.attitude(_status.event.player, current) < 0 && current.countCards('j', { name: 'sha_delay' })) return true;
						if (get.attitude(_status.event.player, current) > 0 && current.maxHp != current.hp) return true;
						return false;
					})) return false;
					return true;
				},
				content: function () {
					'step 0'
					player.chooseTarget('###义绝###选择一名目标', function (card, player, target) {
						if (target == player) return false;
						if (player.storage.yijue.contains(target)) return false;
						return target.hp != target.maxHp || target.countCards('j', { name: 'sha_delay' });
					}).set('ai', function (target) {
						if (get.attitude(_status.event.player, target) < 0 && target.countCards('j', { name: 'sha_delay' })) return target.maxHp - target.hp;
						if (get.attitude(_status.event.player, target) > 0) return target.maxHp - target.hp;
						return false;
					});
					'step 1'
					if (result.targets) {
						player.logSkill('yijue');
						event.target = result.targets[0];
						target = event.target;
						if (event.target.countCards('j', { name: 'sha_delay' }) && event.target.hp == event.target.maxHp) {
							event.num = 1;
							event.goto(2);
						}
						else if (!event.target.countCards('j', { name: 'sha_delay' }) && event.target.hp != event.target.maxHp) {
							event.num = 2;
							event.goto(2);
						}
						else {
							var list = [];
							list.push('该角色判定区内的【杀】立即生效');
							list.push('该角色回复1点体力，然后你与其各摸一张牌');
							player.chooseControlList(get.prompt('yijue'), list,true, function (event, player) {
								if (get.attitude(player, result.targets[0]) < 0) return 0;
								else return 1;
							});
						}
					}
					else {
						event.finish();
					}
					'step 2'
					target = event.target;
					if (result.index == 0 || event.num == 1) {
						var card = target.getCards('j', { name: 'sha_delay' });
						target.phaseJudge(card[0]);
						if (!player.storage.yijue) player.storage.yijue = [];
						player.storage.yijue.push(target);
						player.storage.yijue.sortBySeat();
						player.markSkill('yijue');
					}
					else if (result.index == 1 || event.num == 2) {
						target.recover();
						var list = [player, target];
						game.asyncDraw(list);
						if (!player.storage.yijue) player.storage.yijue = [];
						player.storage.yijue.push(target);
						player.storage.yijue.sortBySeat();
						player.markSkill('yijue');
					}
				},
				intro: {
					content: '已对$发动过〖义绝〗'
				},
				ai: {
					order: 7,
					threaten: 1.5,
					expose: 0.2,
				},
			},

			paoxiao: {
				audio: 2,
				firstDo: true,
				locked:true,
				trigger: { player: 'useCard1' },
				forced: true,
				filter: function (event, player) {
					if (!event.audioed && event.card.name == 'sha' && player.countUsed('sha', true) > 1 && event.getParent().type == 'phase')
						return true;
					if (!event.audioed && event.card.name == 'jiu' && player.countUsed('jiu', true) > 1 && event.getParent().type == 'phase')
						return true;
					return false;
				},
				content: function () {
					trigger.audioed = true;
				},
				mod: {
					cardUsable: function (card, player, num) {
						if (card.name == 'jiu') return Infinity;
						if (card.name == 'sha') return Infinity;
					}
				},
				ai: {
					unequip: true,
					skillTagFilter: function (player, tag, arg) {
						if (!get.zhu(player, 'shouyue')) return false;
						if (arg && arg.name == 'sha') return true;
						if (arg && arg.name == 'jiu') return true;
						return false;
					}
				}
			},
			haoyin: {
				audio: 2,
				locked:false,
				enable: 'chooseToUse',
				filter: function (event, player) {
					return player.countCards('h', { type: 'trick' }) > 0;
				},
				filterCard: function (card) {
					return get.type(card, 'trick') == 'trick';
				},
				selectCard: -1,
				position: 'h',
				viewAs: { name: 'jiu' },
				ai: {
					save: true,
					order: function (item, player) {
						if (!player) return 10;
						if (player.countCards('h', 'sha') == 1)
							return get.order({ name: 'sha' }) + 0.1;
						else {
							if (player.countUsed('sha', true) == 0)
								return get.order({ name: 'sha' }) - 0.1;
							else
								return get.order({ name: 'sha' }) + 0.1;
						}
					},
					result: {
						player: function (player) {
							if (player.hp < 1 && (!player.countCards('h', 'tao') || !player.countCards('h', 'jiu'))) return true;
							if (!player.countCards('h', 'sha')) return false;
							var num = 0;
							var cards = player.getCards('h');
							for (var i = 0; i < cards.length; i++) {
								if (get.type(cards[i], 'trick') == 'trick')
									num += Math.max(0, get.value(cards[i], player, 'raw'));
							}
							num /= player.countCards('h', 'sha');
							return 8 - num;
						}
					},
				}
			},

			longdan: {
				audio: 'longdan_sha',
				locked:false,
				audioname: ['re_zhaoyun'],
				group: ['longdan_sha', 'longdan_shan', 'longdan2'],
				subSkill: {
					sha: {
						audio: 2,
						audioname: ['re_zhaoyun'],
						enable: ['chooseToUse', 'chooseToRespond'],
						filterCard: { name: 'shan' },
						viewAs: { name: 'sha' },
						viewAsFilter: function (player) {
							if (!player.countCards('hs', 'shan')) return false;
						},
						position: 'hs',
						prompt: '将一张闪当杀使用或打出',
						check: function () { return 1 },
						ai: {
							effect: {
								target: function (card, player, target, current) {
									if (get.tag(card, 'respondSha') && current < 0) return 0.6
								}
							},
							respondSha: true,
							skillTagFilter: function (player) {
								if (!player.countCards('hs', 'shan')) return false;
							},
							order: function () {
								return get.order({ name: 'sha' }) + 0.1;
							},
							useful: -1,
							value: -1
						}
					},
					shan: {
						audio: 'longdan_sha',
						audioname: ['re_zhaoyun'],
						enable: ['chooseToRespond', 'chooseToUse'],
						filterCard: { name: 'sha' },
						viewAs: { name: 'shan' },
						prompt: '将一张杀当闪使用或打出',
						check: function () { return 1 },
						position: 'hs',
						viewAsFilter: function (player) {
							if (!player.countCards('hs', 'sha')) return false;
						},
						ai: {
							respondShan: true,
							skillTagFilter: function (player) {
								if (!player.countCards('hs', 'sha')) return false;
							},
							effect: {
								target: function (card, player, target, current) {
									if (get.tag(card, 'respondShan') && current < 0) return 0.6
								}
							},
							order: 4,
							useful: -1,
							value: -1
						}
					}
				}
			},
			longdan2: {
				audio: 'longdan_sha',
				trigger: { player: 'phaseBegin' },
				filter: function (event, player) {
					return player.countCards('h');
				},
				content: function () {
					var sha = player.countCards('h', 'sha');
					var shan = player.countCards('h', 'shan');
					if (shan > sha) player.draw(Math.min(shan, 3));
					else if (sha > shan) player.addTempSkill('longdan3');
				},
				check: function (event, player) {
					return true;
				},
				ai: {
					threaten: 1.2,
					effect: {
						player: function (card, player, target) {
							if (player.countCards('h', 'sha') == player.countCards('h', 'shan'))
								return 0.3;
							return 1;
						}
					}
				}
			},
			longdan3: {
				mod: {
					targetInRange: function (card, player, target, now) {
						if (player.getLastUsed() == null) {
							return true;
						}
					},
					selectTarget: function (card, player, range) {
						if (player.getLastUsed() == null && get.type(card) != 'delay') {
							if (range[1] != -1)
								range[1]++;
						}
					},
				}
			},

			guanxing: {
				audio: 2,
				audioname: ['jiangwei'],
				locked:false,
				trigger: { player: 'phaseZhunbeiBegin' },
				frequent: true,
				preHidden: true,
				content: function () {
					"step 0"
					var num = game.countPlayer() >= 4 ? 6 : 4;
					var cards = get.cards(num);
					game.cardsGotoOrdering(cards);
					var next = player.chooseToMove();
					next.set('list', [
						['牌堆顶', cards],
						['牌堆底'],
					]);
					next.set('prompt', '观星：点击将牌移动到牌堆顶或牌堆底');
					next.processAI = function (list) {
						var cards = list[0][1], player = _status.event.player;
						var top = [];
						var judges = player.getCards('j');
						var stopped = false;
						if (!player.hasWuxie()) {
							for (var i = 0; i < judges.length; i++) {
								var judge = get.judge(judges[i]);
								cards.sort(function (a, b) {
									return judge(b) - judge(a);
								});
								if (judge(cards[0]) < 0) {
									stopped = true; break;
								}
								else {
									top.unshift(cards.shift());
								}
							}
						}
						var bottom;
						if (!stopped) {
							cards.sort(function (a, b) {
								return get.value(b, player) - get.value(a, player);
							});
							while (cards.length) {
								if (get.value(cards[0], player) <= 5) break;
								top.unshift(cards.shift());
							}
						}
						bottom = cards;
						return [top, bottom];
					}
					"step 1"
					var top = result.moved[0];
					var bottom = result.moved[1];
					top.reverse();
					for (var i = 0; i < top.length; i++) {
						ui.cardPile.insertBefore(top[i], ui.cardPile.firstChild);
					}
					for (i = 0; i < bottom.length; i++) {
						ui.cardPile.appendChild(bottom[i]);
					}
					player.popup(get.cnNumber(top.length) + '上' + get.cnNumber(bottom.length) + '下');
					game.log(player, '将' + get.cnNumber(top.length) + '张牌置于牌堆顶');
					game.updateRoundNumber();
					game.delayx();
				},
				ai: {
					threaten: 1.2
				}
			},
			kanpo: {
				mod: {
					aiValue: function (player, card, num) {
						if (get.name(card) != 'wuxie' && get.color(card) != 'black') return;
						var cards = player.getCards('hs', function (card) {
							return get.name(card) == 'wuxie' || get.color(card) == 'black';
						});
						cards.sort(function (a, b) {
							return (get.name(b) == 'wuxie' ? 1 : 2) - (get.name(a) == 'wuxie' ? 1 : 2);
						});
						var geti = function () {
							if (cards.contains(card)) {
								return cards.indexOf(card);
							}
							return cards.length;
						};
						if (get.name(card) == 'wuxie') return Math.min(num, [6, 4, 3][Math.min(geti(), 2)]) * 0.6;
						return Math.max(num, [6, 4, 3][Math.min(geti(), 2)]);
					},
					aiUseful: function () {
						return lib.skill.kanpo.mod.aiValue.apply(this, arguments);
					},
				},
				locked: false,
				audio: 2,
				audioname: ['young_zhugeliang', 'pangtong'],
				position: "hes",
				enable: "chooseToUse",
				filterCard: function (card) {
					return get.color(card) == 'black';
				},
				viewAsFilter: function (player) {
					return player.countCards('hes', { color: 'black' }) > 0;
				},
				viewAs: {
					name: "wuxie",
				},
				prompt: "将一张黑色牌当无懈可击使用",
				check: function (card) { return 8 - get.value(card) },
			},
			kongcheng: {
				mod: {
					targetEnabled: function (card, player, target, now) {
						if (target.countCards('h', { type: 'basic', }) == 0) {
							if (card.name == 'sha' || card.name == 'juedou') return false;
						}
					}
				},
				group: 'kongcheng1',
				global: 'kongcheng2',
				audio: 'kongcheng1',
			},
			kongcheng1: {
				audio: 2,
				trigger: { player: 'loseEnd' },
				forced: true,
				firstDo: true,
				filter: function (event, player) {
					if (player.countCards('h', { type: 'basic', })) return false;
					for (var i = 0; i < event.cards.length; i++) {
						if (event.cards[i].original == 'h') return true;
					}
					return false;
				},
				content: function () { }
			},
			kongcheng2: {
				ai: {
					viewHandcard: true,
					skillTagFilter: function (player, arg, target) {
						return target != player && target.hasSkill('kongcheng') && !target.countCards('h', { type: 'basic', });
					}
				},
			},

			mouji: {
				audio: 2,
				locked:false,
				trigger: {
					player: 'phaseUseBegin',
				},
				filter: function (event, player) {
					delete player.storage.mouji1;
					return player.countCards('h', function(card){
						for (var i = 0; i < player.storage.mouji.length; i++)
							if (player.storage.mouji[i].name == card.name) return false;
						if (card.name == 'wuxie') return false;
						return get.type(card, 'trick') == 'trick';
					});
				},
				init: function (player) {
					player.storage.mouji = [];
				},
				content: function () {
					'step 0'
					if (!player.storage.mouji) player.storage.mouji = [];
					player.chooseCard('h', '将一张锦囊牌作为【计】放置在武将牌上', function (card) {
						var player = _status.event.player;
						for (var i = 0; i < player.storage.mouji.length; i++)
							if (player.storage.mouji[i].name == card.name) return false;
						if (card.name == 'wuxie') return false;
						return get.type(card, 'trick') == 'trick';
					}).set('ai', function (card) {
						if (player.countCards('h', { color: 'red' }))
							return get.value(card);
						return 6 - get.value(card);
					});
					'step 1'
					if (result.cards) {
						var card = result.cards[0];
						player.lose(card, ui.special, 'toStorage');
						player.storage.mouji = player.storage.mouji.concat(card);
						player.syncStorage('mouji');
						player.markSkill('mouji');
						game.log(player, '将', card, '置于武将牌上作为“计”');
						player.draw();
					}
				},
				group: 'mouji1',
				frequent: true,
				preHidden: true,
				intro: {
					content: 'cards',
				},
			},
			mouji1: {
				audio: 'mouji',
				enable: 'phaseUse',
				filter: function (event, player) {
					return player.storage.mouji && player.storage.mouji.length > 0;
				},
				chooseButton: {
					dialog: function (event, player) {
						return ui.create.dialog('谋计', player.storage.mouji, 'hidden');
					},
					filter: function (button, player) {
						if (player.storage.mouji1 && player.storage.mouji1.contains(button.name)) return false;
						return lib.filter.filterCard({ name: button.name }, player, _status.event.getParent());
					},
					check: function (button) {
						return get.value(button);
					},
					backup: function (links, player) {
						return {
							filterCard: function (card, player) {
								return get.color(card) == 'red';
							},
							selectCard: 1,
							viewAs: { name: links[0].name },
							onuse: function (result, player) {
								if (!player.storage.mouji1) player.storage.mouji1 = [];
								player.storage.mouji1.push(result.card.name);
								player.logSkill('mouji');
							}
						}
					},
					prompt: function (links, player) {
						return '请选择' + get.translation(links.name) + '的目标';
					}
				},
				ai: {
					order: 10,
					result: {
						player: function (player) {
							return 10;
						}
					},
					threaten: 1.6,
				}
			},
			bazhen: {
				audio: 2,
				audioname: ['re_sp_zhugeliang', 'ol_sp_zhugeliang', 'ol_pangtong'],
				group: 'bazhen_bagua',
				locked: true,
			},
			bazhen_bagua: {
				audio: 'bazhen',
				audioname: ['re_sp_zhugeliang', 'ol_sp_zhugeliang', 'ol_pangtong'],
				equipSkill: true,
				noHidden: true,
				inherit: 'bagua_skill',
				filter: function (event, player) {
					if (!lib.skill.bagua_skill.filter(event, player)) return false;
					if (!player.isEmpty(2)) return false;
					return true;
				},
				ai: {
					respondShan: true,
					effect: {
						target: function (card, player, target) {
							if (player == target && get.subtype(card) == 'equip2') {
								if (get.equipValue(card) <= 7.5) return 0;
							}
							if (!target.isEmpty(2)) return;
							return lib.skill.bagua_skill.ai.effect.target.apply(this, arguments);
						}
					}
				}
			},

			kuanggu: {
				trigger: { source: 'damageSource' },
				filter: function (event, player) {
					return get.distance(player, event.player) <= 1 && event.num > 0;
				},
				locked:true,
				direct: true,
				audio: 'kuanggu',
				audioname: ['re_weiyan', 'ol_weiyan'],
				preHidden: true,
				content: function () {
					'step 0'
					event.num = trigger.num;
					'step 1'
					var choice;
					if (player.isDamaged() && get.recoverEffect(player) > 0 && (player.countCards('hs', function (card) {
						return card.name == 'sha' && player.hasValueTarget(card);
					}) >= player.getCardUsable('sha'))) {
						choice = 'recover_hp';
					}
					else {
						choice = 'draw_card';
					}
					var next = player.chooseDrawRecover(get.prompt(event.name)).set('logSkill', event.name).set('prompt2', '摸一张牌或回复1点体力');
					next.set('choice', choice);
					next.set('ai', function () {
						return _status.event.getParent().choice;
					});
					next.setHiddenSkill('kuanggu');
					'step 2'
					if (result.control != 'cancel2') {
						event.num--;
						if (event.num > 0) {
							event.goto(1);
						}
					}
				}
			},
			qimou: {
				unique: true,
				limited: true,
				locked:false,
				audio: 2,
				enable: 'phaseUse',
				filter: function (event, player) {
					return !player.storage.qimou;
				},
				init: function (player) {
					player.storage.qimou = false;
				},
				mark: true,
				intro: {
					content: 'limited'
				},
				skillAnimation: true,
				animationColor: 'orange',
				content: function () {
					'step 0'
					var num = player.hp - 1;
					if (player.countCards('hs', { name: ['tao', 'jiu'] })) {
						num = player.hp;
					}
					var map = {};
					var list = [];
					for (var i = 1; i <= player.hp; i++) {
						var cn = get.cnNumber(i, true);
						map[cn] = i;
						list.push(cn);
					}
					event.map = map;
					player.awakenSkill('qimou');
					player.storage.qimou = true;
					player.chooseControl(list, function () {
						return get.cnNumber(_status.event.goon, true);
					}).set('prompt', '失去任意点体力').set('goon', num);
					'step 1'
					var num = event.map[result.control] || 1;
					player.loseHp(num);
					player.draw(num);
					player.addTempSkill('qimou2');
					player.storage.qimou2 = num;
				},
				ai: {
					order: 14,
					result: {
						player: function (player) {
							if (player.hp < 3) return false;
							var mindist = player.hp;
							if (player.countCards('hs', { name: ['tao', 'jiu'] })) mindist++;
							if (game.hasPlayer(function (current) {
								return (get.distance(player, current) <= mindist &&
									player.canUse('sha', current, false) &&
									get.effect(current, { name: 'sha' }, player, player) > 0);
							})) {
								return 1;
							}
							return 0;
						}
					}
				}
			},
			qimou2: {
				onremove: true,
				mod: {
					cardUsable: function (card, player, num) {
						if (typeof player.storage.qimou2 == 'number' && card.name == 'sha') {
							return num + player.storage.qimou2;
						}
					},
					globalFrom: function (from, to, distance) {
						if (typeof from.storage.qimou2 == 'number') {
							return distance - from.storage.qimou2;
						}
					}
				}
			},

			tiaoxin: {
				audio: 2,
				locked:false,
				audioname: ['sp_jiangwei', 'xiahouba', 're_jiangwei', 'gz_jiangwei', 'ol_jiangwei'],
				enable: 'phaseUse',
				usable: 1,
				filterTarget: function (card, player, target) {
					return target != player && target.inRange(player) && target.countCards('he') > 0;
				},
				content: function () {
					"step 0"
					target.chooseToUse(function (card, player, event) {
						if (get.name(card) != 'sha') return false;
						return lib.filter.filterCard.apply(this, arguments);
					}, '挑衅：对' + get.translation(player) + '使用一张杀，或令其弃置你的一张牌').set('targetRequired', true).set('complexSelect', true).set('filterTarget', function (card, player, target) {
						if (target != _status.event.sourcex && !ui.selected.targets.contains(_status.event.sourcex)) return false;
						return lib.filter.filterTarget.apply(this, arguments);
					}).set('sourcex', player);
					"step 1"
					if (result.bool == false && target.countCards('he') > 0) {
						player.discardPlayerCard(target, 'he', true);
					}
					else {
						event.finish();
					}
				},
				ai: {
					order: 4,
					expose: 0.2,
					result: {
						target: -1,
						player: function (player, target) {
							if (target.countCards('h') == 0) return 0;
							if (target.countCards('h') == 1) return -0.1;
							if (player.hp <= 2) return -2;
							if (player.countCards('h', 'shan') == 0) return -1;
							return -0.5;
						}
					},
					threaten: 1.1
				}
			},
			zhiji: {
				skillAnimation: true,
				animationColor: 'fire',
				audio: 2,
				derivation: ['hanzhi', 'guanxing'],
				unique: true,
				juexingji: true,
				//priority:-10,
				trigger: { player: 'phaseZhunbeiBegin' },
				forced: true,
				filter: function (event, player) {
					if (player.storage.zhiji) return false;
					return player.countCards('h') == 0&&player.countCards('e') == 0&&player.countCards('j') == 0;
				},
				content: function () {
					"step 0"
					player.awakenSkill('zhiji');
					"step 1"
					player.loseMaxHp();
					player.storage.zhiji = true;
					if (player.hp > player.maxHp) player.hp = player.maxHp;
					'step 2'
					var list = ['club', 'spade', 'diamond', 'heart'];
					for (var i = 0; i < player.storage.disableSuit.length; i++)
						list.remove(player.storage.disableSuit[i]);
					player.chooseControl(list, true).set('ai', function (event, player) {
						var cnt = [0, 0, 0, 0];
						var cntv = [0, 0, 0, 0];
						var list = ['club', 'spade', 'diamond', 'heart'];
						for (var i = 0; i < player.storage.disableSuit.length; i++)
							list.remove(player.storage.disableSuit[i]);
						var cards = player.getCards('h');
						for (var i = 0; i < cards.length; i++) {
							if (!list.contains(get.suit(cards[i]))) continue;
							if (get.suit(cards[i]) == 'club') {
								cnt[0]++;
								if (get.value(cards[i]) <= 5)
									cntv[0]++;
							}
							else if (get.suit(cards[i]) == 'spade') {
								cnt[1]++;
								if (get.value(cards[i]) <= 5)
									cntv[1]++;
							}
							else if (get.suit(cards[i]) == 'diamond') {
								cnt[2]++;
								if (get.value(cards[i]) <= 5)
									cntv[2]++;
							}
							else if (get.suit(cards[i]) == 'heart') {
								cnt[3]++;
								if (get.value(cards[i]) <= 5)
									cntv[3]++;
							}
						}
						var num1 = 500;
						var num2 = 500;
						var choose;
						if (list.contains('club')) {
							if (num1 > cntv[0]) {
								num1 = cntv[0];
								num2 = cnt[0];
								choose = 'club';
							}
							else if (num1 == cntv[0] && num2 > cnt[0]) {
								num1 = cntv[0];
								num2 = cnt[0];
								choose = 'club';
							}

						}
						if (list.contains('spade')) {
							if (num1 > cntv[1]) {
								num1 = cntv[1];
								num2 = cnt[1];
								choose = 'spade';
							}
							else if (num1 == cntv[1] && num2 > cnt[1]) {
								num1 = cntv[1];
								num2 = cnt[1];
								choose = 'spade';
							}
						}
						if (list.contains('diamond')) {
							if (num1 > cntv[2]) {
								num1 = cntv[2];
								num2 = cnt[2];
								choose = 'diamond';
							}
							else if (num1 == cntv[2] && num2 > cnt[2]) {
								num1 = cntv[2];
								num2 = cnt[2];
								choose = 'diamond';
							}
						}
						if (list.contains('heart')) {
							if (num1 > cntv[3]) {
								num1 = cntv[3];
								num2 = cnt[3];
								choose = 'heart';
							}
							else if (num1 == cntv[3] && num2 > cnt[3]) {
								num1 = cntv[3];
								num2 = cnt[3];
								choose = 'heart';
							}
						}
						console.log(num1, num2, choose);
						return choose;
					}).set('prompt', '废除一种花色');
					'step 3'
					if(result.control){
						player.disableSuit(result.control);
						player.addSkill(['guanxing', 'hanzhi']);
					}
				}
			},

			jizhi: {
				audio: 2,
				locked: false,
				trigger: { player: 'useCard' },
				frequent: true,
				filter: function (event) {
					return (get.type(event.card) == 'trick' && event.card.isCard);
				},
				init: function (player) {
					player.storage.jizhi = 0;
				},
				content: function () {
					'step 0'
					player.draw();
					'step 1'
					event.card = result[0];
					var cards = player.getCards('h');
					var yes = false;
					if (cards.length && event.card) {
						for (var i = 0; i < cards.length; i++)
							if (cards[i].cardid == event.card.cardid)
								yes = true;
					}
					if (get.type(event.card) == 'basic' && yes) {
						player.chooseBool('是否弃置' + get.translation(event.card) + '并令本回合手牌上限+1？').set('ai', function (evt, player) {
							return _status.currentPhase == player && player.needsToDiscard(-3) && _status.event.value < 6;
						}).set('value', get.value(event.card, player));
					}
					'step 2'
					if (result.bool) {
						player.discard(event.card);
						player.storage.jizhi++;
						if (_status.currentPhase == player) {
							player.markSkill('jizhi');
						}
					}
				},
				ai: {
					threaten: 1.4,
					noautowuxie: true,
				},
				mod: {
					maxHandcard: function (player, num) {
						return num + player.storage.jizhi;
					}
				},
				intro: {
					content: '本回合手牌上限+#'
				},
				group: 'jizhi_clear',
				subSkill: {
					clear: {
						trigger: { global: 'phaseAfter' },
						silent: true,
						content: function () {
							player.storage.jizhi = 0;
							player.unmarkSkill('jizhi');
						}
					}
				}
			},
			qicai: {
				audio: 2,
				locked:true,
				forced: true,
				trigger: { player: 'useCardEnd' },
				filter: function (event, player) {
					if (get.type(event.card) == 'delay' && get.type(event.card, 'trick') == 'trick' && lib.card[event.card.name].isdelay == true)
						return true;
					return false;
				},
				content: function () {
					trigger.targets[0].phaseJudge(trigger.card);
				},
				mod: {
					targetInRange: function (card, player, target, now) {
						var type = get.type(card,'trick');
						if (type == 'trick') return true;
					}
				},
			},

			shushen: {
				audio: 2,
				locked:false,
				trigger: { global: 'recoverAfter' },
				content: function () {
					trigger.player.draw('nodelay');
				},
				check: function (event, player) {
					if (get.attitude(player, event.player) < 0) return false;
					return true;
				},
				ai: {
					threaten: 0.8,
					expose: 0.2
				}
			},
			shenzhi: {
				audio: 2,
				locked:false,
				trigger: { global: 'phaseZhunbeiBegin' },
				direct: true,
				popup: false,
				filter: function (event, player) {
					return player.countCards('h') >= _status.currentPhase.hp && _status.currentPhase.hp != _status.currentPhase.maxHp && _status.currentPhase != player;
				},
				content: function () {
					'step 0'
					player.chooseToDiscard(get.prompt2('shenzhi'), trigger.player.hp).set('ai', function (card) {
						if (get.attitude(player, trigger.player) <= 0) return false;
						if (trigger.player.hp >= 3) return false;
						return 8 - get.value(card);
					});
					"step 1"
					if (result.bool) {
						player.logSkill('shenzhi');
						trigger.player.recover(1, 'star');
					}
				},
				ai: {
					threaten: 1.1,
					expose: 0.3
				}
			},

			fumian: {
				trigger: {
					global: 'phaseBefore',
					player: 'enterGame',
				},
				audio: 2,
				forced: true,
				locked: false,
				filter: function (event, player) {
					return (event.name != 'phase' || game.phaseNumber == 0);
				},
				content: function () {
					var card = game.createCard('fushou', 'heart', 13);
					player.$gain2(card, false);
					player.addJudge(card);
				},
				group: ['fumian1'],
			},
			fumian1: {
				trigger: {
					global: 'judgeAfter',
				},
				audio: 'fumian',
				direct: true,
				popup: false,
				filter: function (event, player) {
					if (!event.card) return false;
					if (event.card.name != 'fushou') return false;
					if (!player.storage.fumian1) player.storage.fumian1 = [];
					if (event.result.bool == false) return false;
					if (game.hasPlayer(function (current) {
						return !player.storage.fumian1.contains(current) && _status.currentjudger != current;
					})) return true;
					return false;
				},
				content: function () {
					'step 0'
					player.storage.fumian1.push(_status.currentjudger);
					player.markSkill('fumian1');
					player.chooseTarget(get.prompt('fumian'), '你可以将【福寿延绵】移动到一名没有‘福’标记的角色的判定区中', function (card, player, target) {
						return !player.storage.fumian1.contains(target);
					}).set('ai', function (target) {
						if (get.attitude(_status.event.player, target) < 0) return false;
						return get.attitude(_status.event.player, target) / target.countCards('he');
					})
					'step 1'
					if (result.bool) {
						//fuyoumianmian
						lib.config.fuyoumianmian.cnt++;
						game.saveConfig('fuyoumianmian', lib.config.fuyoumianmian);
						//fuyoumianmian
						player.logSkill('fumian');
						var card = game.createCard('fushou', 'heart', 13);
						result.targets[0].$gain2(card, false);
						result.targets[0].addJudge(card, card, trigger.player);
					}
				},
				intro: {
					content: function (storage, player, skill) {

						if (player.storage.fumian1.length) {
							return get.translation(player.storage.fumian1) + "的【福寿延绵】判定生效";
						}
						else
							return "没有人的【福寿延绵】判定生效";
					},
				},
			},
			fumian_destroy: {
				trigger: { global: ['loseEnd', 'cardsDiscardEnd'] },
				forced: true,
				charlotte: true,
				filter: function (event, player) {
					var cs = event.cards;
					for (var i = 0; i < cs.length; i++) {
						if (cs[i].name == 'fushou' && get.position(cs[i], true) != 'j') return true;
					}
					return false;
				},
				forceDie: true,
				content: function () {
					if (!_status.fumian) _status.fumian = {};
					var cs = trigger.cards;
					for (var i = 0; i < cs.length; i++) {
						if (cs[i].name == 'fushou' && get.position(cs[i], true) != 'j') {
							_status.fumian[cs[i].name] = false;
							cs[i].remove();
							cs[i].destroyed = true;
						}
					}
				},
			},
			daiyan: {
				trigger: {
					player: 'phaseJieshuBegin',
				},
				group: ['fumian_destroy'],
				audio: 2,
				forced: true,
				locked: true,
				filter: function (event, player) {
					if (game.hasPlayer(function (current) {
						return current.countCards('j', 'fushou');
					})) return false;
					return true;
				},
				content: function () {
					var card = game.createCard('fushou', 'heart', 13);
					player.$gain2(card, false);
					player.addJudge(card);
					player.loseHp();
					player.unmarkSkill('fumian1');
					delete player.storage.fumian1;
				},
			},

			jianxiong: {
				audio: 2,
				locked: false,
				trigger: {
					player: "damageEnd",
				},
				content: function () {
					"step 0"
					if (get.itemtype(trigger.cards) == 'cards' && get.position(trigger.cards[0], true) == 'o') {
						player.gain(trigger.cards, "gain2");
					}
					player.draw('nodelay');
				},
				ai: {
					maixie: true,
					"maixie_hp": true,
					effect: {
						target: function (card, player, target) {
							if (player.hasSkillTag('jueqing', false, target)) return [1, -1];
							if (get.tag(card, 'damage') && player != target) return [1, 0.6];
						},
					},
				},
			},
			hujia: {
				audio: 2,
				audioname: ['re_caocao'],
				unique: true,
				zhuSkill: true,
				trigger: { player: ['chooseToRespondBefore', 'chooseToUseBefore'] },
				filter: function (event, player) {
					if (event.responded) return false;
					if (player.storage.hujiaing) return false;
					if (!player.hasZhuSkill('hujia')) return false;
					if (!event.filterCard({ name: 'shan' }, player, event)) return false;
					return game.hasPlayer(function (current) {
						return current != player && current.group == 'wei';
					});
				},
				check: function (event, player) {
					if (get.damageEffect(player, event.player, player) >= 0) return false;
					return true;
				},
				content: function () {
					"step 0"
					if (event.current == undefined) event.current = player.next;
					if (event.current == player) {
						event.finish();
					}
					else if (event.current.group == 'wei') {
						if ((event.current == game.me && !_status.auto) || (
							get.attitude(event.current, player) > 2) ||
							event.current.isOnline()) {
							player.storage.hujiaing = true;
							var next = event.current.chooseToRespond('是否替' + get.translation(player) + '打出一张闪？', { name: 'shan' });
							next.set('ai', function () {
								var event = _status.event;
								return (get.attitude(event.player, event.source) - 2);
							});
							next.set('skillwarn', '替' + get.translation(player) + '打出一张闪');
							next.autochoose = lib.filter.autoRespondShan;
							next.set('source', player);
						}
					}
					"step 1"
					player.storage.hujiaing = false;
					if (result.bool) {
						event.finish();
						trigger.result = { bool: true, card: { name: 'shan', isCard: true } };
						trigger.responded = true;
						trigger.animate = false;
						if (typeof event.current.ai.shown == 'number' && event.current.ai.shown < 0.95) {
							event.current.ai.shown += 0.3;
							if (event.current.ai.shown > 0.95) event.current.ai.shown = 0.95;
						}
					}
					else {
						event.current = event.current.next;
						event.goto(0);
					}
				},
				ai: {
					respondShan: true,
					skillTagFilter: function (player) {
						if (player.storage.hujiaing) return false;
						if (!player.hasZhuSkill('hujia')) return false;
						return game.hasPlayer(function (current) {
							return current != player && current.group == 'wei';
						});
					},
				},
			},

			tuxi: {
				audio: 2,
				trigger: { player: 'phaseDrawBegin2' },
				direct: true,
				locked: false,
				filter: function (event) {
					return event.num > 0;
				},
				content: function () {
					"step 0"
					player.chooseTarget(get.prompt('tuxi'), [1, trigger.num], function (card, player, target) {
						return target.countCards('h') > 0 && player != target;
					}, function (target) {
						var att = get.attitude(_status.event.player, target);
						if (target.hasSkill('tuntian')) return att / 10;
						return 1 - att;
					});
					"step 1"
					if (result.bool) {
						player.logSkill('tuxi', result.targets);
						player.gainMultiple(result.targets);
						trigger.num -= result.targets.length;
					}
					else {
						event.finish();
					}
					"step 2"
					if (trigger.num <= 0) game.delay();
				},
				ai: {
					threaten: 1.6,
					expose: 0.2
				}
			},

			tiandu: {
				audio: 2,
				trigger: { player: 'judgeEnd' },
				preHidden: true,
				locked: false,
				frequent: function (event) {
					if (event.result.card.name == 'du') return false;
					//if(get.mode()=='guozhan') return false;
					return true;
				},
				check: function (event) {
					if (event.result.card.name == 'du') return false;
					return true;
				},
				filter: function (event, player) {
					return get.position(event.result.card, true) == 'o';
				},
				content: function () {
					player.gain(trigger.result.card, 'gain2');
				}
			},
			yiji: {
				audio: 2,
				trigger: {
					player: "damageEnd",
				},
				locked: false,
				frequent: true,
				filter: function (event) {
					return (event.num > 0)
				},
				content: function () {
					"step 0"
					event.count = 1;
					"step 1"
					player.draw(2);
					event.given = 0;
					"step 2"
					player.chooseCardTarget({
						filterCard: true,
						selectCard: [1, 2 - event.given],
						filterTarget: function (card, player, target) {
							return player != target && target != event.temp;
						},
						ai1: function (card) {
							if (ui.selected.cards.length > 0) return -1;
							if (card.name == 'du') return 20;
							return (_status.event.player.countCards('h') - _status.event.player.hp);
						},
						ai2: function (target) {
							var att = get.attitude(_status.event.player, target);
							if (ui.selected.cards.length && ui.selected.cards[0].name == 'du') {
								if (target.hasSkillTag('nodu')) return 0;
								return 1 - att;
							}
							return att - 4;
						},
						prompt: '请选择要送人的卡牌'
					});
					"step 3"
					if (result.bool) {
						player.line(result.targets, 'green');
						result.targets[0].gain(result.cards, player, 'giveAuto');
						event.given += result.cards.length;
						if (event.given < 2) {
							event.temp = result.targets[0];
							event.goto(2);
						}
						else if (event.count < trigger.num) {
							delete event.temp;
							event.count++;
							player.chooseBool(get.prompt2(event.name)).set('frequentSkill', event.name);
						}
						else event.finish();
					}
					else if (event.count < trigger.num) {
						delete event.temp;
						event.count++;
						player.chooseBool(get.prompt2(event.name)).set('frequentSkill', event.name);
					}
					else event.finish();
					"step 4"
					if (result.bool) {
						player.logSkill(event.name);
						event.goto(1);
					}
				},
				ai: {
					maixie: true,
					"maixie_hp": true,
					result: {
						effect: function (card, player, target) {
							if (get.tag(card, 'damage')) {
								if (player.hasSkillTag('jueqing', false, target)) return [1, -2];
								if (!target.hasFriend()) return;
								var num = 1;
								if (get.attitude(player, target) > 0) {
									if (player.needsToDiscard()) {
										num = 0.7;
									}
									else {
										num = 0.5;
									}
								}
								if (player.hp >= 4) return [1, num * 2];
								if (target.hp == 3) return [1, num * 1.5];
								if (target.hp == 2) return [1, num * 0.5];
							}
						},
					},
					threaten: 0.6,
				},
			},

			ganglie: {
				audio: 2,
				locked: false,
				trigger: { player: 'damageEnd' },
				filter: function (event, player) {
					return (event.source != undefined && event.num > 0);
				},
				check: function (event, player) {
					return (get.attitude(player, event.source) <= 0);
				},
				logTarget: 'source',
				preHidden: true,
				content: function () {
					"step 0"
					event.num = trigger.num;
					"step 1"
					player.judge(function (card) {
						if (get.color(card) == 'red') return 1;
						return 0;
					});
					"step 2"
					if (result.color == 'black') {
						if (trigger.source.countCards('hej')) {
							player.discardPlayerCard(trigger.source, 'hej', true);
						}
					}
					else if (result.color == 'red'&&trigger.source.isIn()) {
						trigger.source.damage();
					}
					event.num--;
					if (event.num > 0) {
						player.chooseBool(get.prompt2('ganglie'));
					}
					else {
						event.finish();
					}
					"step 3"
					if (result.bool) {
						player.logSkill('ganglie', trigger.source);
						event.goto(1);
					}
				},
				ai: {
					maixie_defend: true,
					expose: 0.4
				}
			},

			quanji: {
				audio: 2,
				trigger: { player: 'damageEnd' },
				frequent: true,
				locked: false,
				notemp: true,
				init: function (player) {
					if (!player.storage.quanji) player.storage.quanji = [];
				},
				filter: function (event) {
					return event.num > 0;
				},
				content: function () {
					"step 0"
					event.count = trigger.num;
					"step 1"
					event.count--;
					player.draw();
					"step 2"
					if (player.countCards('h')) {
						player.chooseCard('将一张手牌置于武将牌上作为“权”', true);
					}
					else {
						event.goto(4);
					}
					"step 3"
					if (result.cards && result.cards.length) {
						player.lose(result.cards, ui.special, 'toStorage');
						player.storage.quanji = player.storage.quanji.concat(result.cards);
						player.syncStorage('quanji');
						player.markSkill('quanji');
						game.log(player, '将', result.cards, '置于武将牌上作为“权”');
					}
					"step 4"
					if (event.count > 0) {
						player.chooseBool(get.prompt2('quanji')).set('frequentSkill', 'quanji');
					}
					else event.finish();
					"step 5"
					if (result.bool) {
						player.logSkill('quanji');
						event.goto(1);
					}
				},
				intro: {
					content: 'cards',
					onunmark: function (storage, player) {
						if (storage && storage.length) {
							player.$throw(storage, 1000);
							game.cardsDiscard(storage);
							game.log(storage, '被置入了弃牌堆');
							storage.length = 0;
						}
					},
				},
				mod: {
					maxHandcard: function (player, num) {
						return num + player.storage.quanji.length;
					}
				},
				ai: {
					maixie: true,
					maixie_hp: true,
					threaten: 0.8,
					effect: {
						target: function (card, player, target) {
							if (get.tag(card, 'damage')) {
								if (player.hasSkillTag('jueqing', false, target)) return [1, -2];
								if (!target.hasFriend()) return;
								if (target.hp >= 4) return [0.5, get.tag(card, 'damage') * 2];
								if (!target.hasSkill('paiyi') && target.hp > 1) return [0.5, get.tag(card, 'damage') * 1.5];
								if (target.hp == 3) return [0.5, get.tag(card, 'damage') * 1.5];
								if (target.hp == 2) return [1, get.tag(card, 'damage') * 0.5];
							}
						}
					}
				}
			},
			zili: {
				skillAnimation: true,
				animationColor: 'thunder',
				audio: 2,
				derivation: ['paiyi'],
				unique: true,
				juexingji: true,
				trigger: { player: 'phaseZhunbeiBegin' },
				forced: true,
				filter: function (event, player) {
					return !player.hasSkill('paiyi') && player.storage.quanji && player.storage.quanji.length >= 3;
				},
				content: function () {
					"step 0"
					player.chooseDrawRecover(2, true, function (event, player) {
						if (player.hp == 1 && player.isDamaged()) return 'recover_hp';
						return 'draw_card';
					});
					"step 1"
					player.loseMaxHp();
					player.addSkill('paiyi');
					player.awakenSkill('zili');
				}
			},
			paiyi: {
				enable: 'phaseUse',
				usable: 1,
				audio: 2,
				audioname: ['re_zhonghui'],
				filter: function (event, player) {
					return player.storage.quanji && player.storage.quanji.length > 0;
				},
				chooseButton: {
					dialog: function (event, player) {
						return ui.create.dialog('排异', player.storage.quanji, 'hidden')
					},
					backup: function (links, player) {
						return {
							audio: 'paiyi',
							audioname: ['re_zhonghui'],
							filterTarget: true,
							filterCard: function () { return false },
							selectCard: -1,
							card: links[0],
							delay: false,
							content: lib.skill.paiyi.contentx,
							ai: {
								order: 10,
								result: {
									target: function (player, target) {
										if (player != target) return 0;
										if (player.hasSkill('requanji') || (player.countCards('h') + 2 <= player.hp + player.storage.quanji.length)) return 1;
										return 0;
									}
								},
							},
						}
					},
					prompt: function () { return '请选择〖排异〗的目标' },
				},
				contentx: function () {
					"step 0"
					var card = lib.skill.paiyi_backup.card;
					game.cardsDiscard(card);
					player.$throw(card);
					player.storage.quanji.remove(card);
					game.log(card, '进入了弃牌堆');
					if (!player.storage.quanji.length) {
						player.unmarkSkill('quanji');
					}
					else {
						player.markSkill('quanji');
					}
					player.syncStorage('quanji');
					game.delayx();
					"step 1"
					target.draw(2);
					"step 2"
					if (target.countCards('h') > player.countCards('h')) {
						target.damage();
					}
				},
				ai: {
					order: 1,
					combo: 'quanji',
					result: {
						player: 1,
					}
				}
			},

			duanliang: {
				audio: 2,
				enable: 'chooseToUse',
				filterCard: function (card) {
					return get.color(card) == 'black';
				},
				filter: function (event, player) {
					return player.countCards('hes', { color: 'black' })
				},
				position: 'hes',
				viewAs: { name: 'bingliang' },
				prompt: '将一张黑色牌当兵粮寸断使用',
				check: function (card) { return 6 - get.value(card) },
				ai: {
					order: 9
				}
			},
			jiezi: {
				trigger: { global: 'phaseJudgeBegin' },
				audio: 2,
				round: 1,
				filter: function (event, player) {
					return event.player.countCards('j') && event.getParent().name == 'phase';
				},
				content: function () {
					player.draw(trigger.player.countCards('j'));
				}
			},

			qice: {
				enable: 'phaseUse',
				usable: 1,
				audio: 'qice_backup',
				filter: function (event, player) {
					var hs = player.getCards('h');
					if (!hs.length) return false;
					for (var i = 0; i < hs.length; i++) {
						var mod2 = game.checkMod(hs[i], player, 'unchanged', 'cardEnabled2', player);
						if (mod2 === false) return false;
					}
					return true;
				},
				chooseButton: {
					dialog: function (player) {
						var list = [];
						for (var i = 0; i < lib.inpile.length; i++) {
							if (get.type(lib.inpile[i]) == 'trick') list.push(['锦囊', '', lib.inpile[i]]);
						}
						return ui.create.dialog(get.translation('qice'), [list, 'vcard']);
					},
					filter: function (button, player) {
						return lib.filter.filterCard({ name: button.link[2] }, player, _status.event.getParent());
					},
					check: function (button) {
						var player = _status.event.player;
						var recover = 0, lose = 1, players = game.filterPlayer();
						for (var i = 0; i < players.length; i++) {
							if (players[i].hp == 1 && get.damageEffect(players[i], player, player) > 0 && !players[i].hasSha()) {
								return (button.link[2] == 'juedou') ? 2 : -1;
							}
							if (!players[i].isOut()) {
								if (players[i].hp < players[i].maxHp) {
									if (get.attitude(player, players[i]) > 0) {
										if (players[i].hp < 2) {
											lose--;
											recover += 0.5;
										}
										lose--;
										recover++;
									}
									else if (get.attitude(player, players[i]) < 0) {
										if (players[i].hp < 2) {
											lose++;
											recover -= 0.5;
										}
										lose++;
										recover--;
									}
								}
								else {
									if (get.attitude(player, players[i]) > 0) {
										lose--;
									}
									else if (get.attitude(player, players[i]) < 0) {
										lose++;
									}
								}
							}
						}
						if (lose > recover && lose > 0) return (button.link[2] == 'mingan') ? 1 : -1;
						if (lose < recover && recover > 0) return (button.link[2] == 'taoyuan') ? 1 : -1;
						return (button.link[2] == 'wuzhong') ? 1 : -1;
					},
					backup: function (links, player) {
						return {
							filterCard: true,
							selectCard: -1,
							position: 'h',
							audio: 2,
							popname: true,
							viewAs: { name: links[0][2] },
							onuse: function (result, player) {
								player.draw('nodelay');
							}
						}
					},
					prompt: function (links, player) {
						return '将全部手牌当作' + get.translation(links[0][2]) + '使用';
					}
				},
				ai: {
					order: 1,
					result: {
						player: function (player) {
							var num = 0;
							var cards = player.getCards('h');
							if (cards.length >= 3 && player.hp >= 3) return 0;
							for (var i = 0; i < cards.length; i++) {
								num += Math.max(0, get.value(cards[i], player, 'raw'));
							}
							num /= cards.length;
							num *= Math.min(cards.length, player.hp);
							return 12 - num;
						}
					},
					threaten: 1.6,
				}
			},
			qice_backup: { audio: 2 },
			zhiyu: {
				audio: 2,
				trigger: { player: 'damageEnd' },
				preHidden: true,
				content: function () {
					"step 0"
					event.num = trigger.num;
					'step 1'
					player.draw();
					"step 2"
					if (!player.countCards('h')) event.goto(4);
					else player.showHandcards();
					"step 3"
					if (!trigger.source) return;
					var cards = player.getCards('h');
					var color = get.color(cards[0], player);
					for (var i = 1; i < cards.length; i++) {
						if (get.color(cards[i], player) != color) return;
					}
					trigger.source.chooseToDiscard(true);
					'step 4'
					event.num--;
					if (event.num > 0) {
						player.chooseBool(get.prompt2('zhiyu'));
					}
					else {
						event.finish();
					}
					'step 5'
					if (result.bool) {
						player.logSkill('zhiyu', trigger.source);
						event.goto(1);
					}
				},
				ai: {
					maixie_defend: true,
					threaten: 0.9
				}
			},

			chenqing: {
				audio: 2,
				trigger: { global: 'dying' },
				//priority:6,
				locked: false,
				filter: function (event, player) {
					return event.player.hp <= 0 && !player.hasSkill('chenqing2');
				},
				direct: true,
				content: function () {
					'step 0'
					player.chooseTarget(get.prompt2('chenqing'), function (card, player, target) {
						return target != player && target != _status.event.getTrigger().player;
					}).set('ai', function (target) {
						var player = _status.event.player;
						var trigger = _status.event.getTrigger();
						if (get.attitude(player, trigger.player) > 0) {
							var att1 = get.attitude(target, player);
							var att2 = get.attitude(target, trigger.player);
							var att3 = get.attitude(player, target);
							if (att3 < 0) return 0;
							return att1 / 2 + att2 + att3;
						}
						else {
							return 0;
							// return get.attitude(player,target);
						}
					});
					'step 1'
					if (result.bool) {
						player.addTempSkill('chenqing2', 'roundStart');
						event.target = result.targets[0];
						event.target.draw(4);
						player.logSkill('chenqing', event.target);
					}
					else {
						event.finish();
					}
					'step 2'
					var target = event.target;
					var tosave = trigger.player;
					var att = get.attitude(target, tosave);
					var hastao = target.countCards('h', 'tao');
					target.chooseToDiscard(4, true, 'he').set('ai', function (card) {
						var hastao = _status.event.hastao;
						var att = _status.event.att;
						if (!hastao && att > 0) {
							var suit = get.suit(card);
							for (var i = 0; i < ui.selected.cards.length; i++) {
								if (get.suit(ui.selected.cards[i]) == suit) {
									return -4 - get.value(card);
								}
							}
						}
						if (att < 0 && ui.selected.cards.length == 3) {
							var suit = get.suit(card);
							for (var i = 0; i < ui.selected.cards.length; i++) {
								if (get.suit(ui.selected.cards[i]) == suit) {
									return -get.value(card);
								}
							}
							return -10 - get.value(card);
						}
						return -get.value(card);
					}).set('hastao', hastao).set('att', att);
					'step 3'
					if (result.cards && result.cards.length == 4) {
						var suits = [];
						for (var i = 0; i < result.cards.length; i++) {
							suits.add(get.suit(result.cards[i]));
						}
						if (suits.length == 4 && game.checkMod({ name: 'tao', isCard: true }, player, trigger.player, 'unchanged', 'cardSavable', player)) {
							event.target.useCard({ name: 'tao', isCard: true }, trigger.player);
						}
					}
				},
				ai: {
					expose: 0.2,
					threaten: 1.5,
				}
			},
			chenqing2: {},
			moshi: {
				audio: 2,
				trigger: { player: 'phaseJieshuBegin' },
				locked: false,
				direct: true,
				filter: function (event, player) {
					return player.getHistory('useCard', function (evt) {
						return evt.isPhaseUsing() && ['basic', 'trick'].contains(get.type(evt.card));
					}).length > 0 && player.countCards('hs') > 0;
				},
				content: function () {
					"step 0"
					event.count = 2;
					event.history = player.getHistory('useCard', function (evt) {
						return evt.isPhaseUsing() && ['basic', 'trick'].contains(get.type(evt.card));
					})
					"step 1"
					event._result = {};
					if (event.count && event.history.length && player.countCards('hs')) {
						event.count--;
						var card = event.history.shift().card;
						card = { name: card.name, nature: card.nature };
						if (card.name != 'jiu' && lib.filter.cardEnabled(card)) {
							if (game.hasPlayer(function (current) {
								return player.canUse(card, current);
							})) {
								lib.skill.moshix.viewAs = card;
								var next = player.chooseToUse();
								if (next.isOnline()) {
									player.send(function (card) {
										lib.skill.moshix.viewAs = card;
									}, card)
								}
								next.logSkill = 'moshi';
								next.set('openskilldialog', '默识：将一张手牌当' + get.translation(card) + '使用');
								next.set('norestore', true);
								next.set('_backupevent', 'moshix');
								next.set('custom', {
									add: {},
									replace: { window: function () { } }
								});
								next.backup('moshix');
							}
						}
					}
					"step 2"
					if (result && result.bool) event.goto(1);
				},
			},
			moshix: {
				filterCard: function (card) {
					return get.itemtype(card) == 'card';
				},
				selectCard: 1,
				position: 'hs',
				popname: true,
			},

			qingguo: {
				mod: {
					aiValue: function (player, card, num) {
						if (get.name(card) != 'shan' && get.color(card) != 'black') return;
						var cards = player.getCards('hs', function (card) {
							return get.name(card) == 'shan' || get.color(card) == 'black';
						});
						cards.sort(function (a, b) {
							return (get.name(b) == 'shan' ? 1 : 2) - (get.name(a) == 'shan' ? 1 : 2);
						});
						var geti = function () {
							if (cards.contains(card)) {
								return cards.indexOf(card);
							}
							return cards.length;
						};
						if (get.name(card) == 'shan') return Math.min(num, [6, 4, 3][Math.min(geti(), 2)]) * 0.6;
						return Math.max(num, [6.5, 4, 3][Math.min(geti(), 2)]);
					},
					aiUseful: function () {
						return lib.skill.qingguo.mod.aiValue.apply(this, arguments);
					},
				},
				locked: false,
				audio: 2,
				enable: ['chooseToRespond', 'chooseToUse'],
				filterCard: function (card) {
					return get.color(card) == 'black';
				},
				position: 'hes',
				viewAs: { name: 'shan' },
				viewAsFilter: function (player) {
					if (!player.countCards('hes', { color: 'black' })) return false;
				},
				prompt: '将一张黑色牌当闪打出',
				check: function () { return 1 },
				ai: {
					order: 2,
					respondShan: true,
					skillTagFilter: function (player) {
						if (!player.countCards('hes', { color: 'black' })) return false;
					},
					effect: {
						target: function (card, player, target, current) {
							if (get.tag(card, 'respondShan') && current < 0) return 0.6
						}
					}
				}
			},
			luoshen: {
				audio: 2,
				locked: false,
				trigger: { player: 'phaseZhunbeiBegin' },
				frequent: true,
				content: function () {
					"step 0"
					player.addTempSkill('luoshen_add');
					event.cards = [];
					"step 1"
					var next = player.judge(function (card) {
						if (get.color(card) == 'black') return 1.5;
						return -1.5;
					});
					next.judge2 = function (result) {
						return result.bool;
					};
					if (get.mode() != 'guozhan' && !player.hasSkillTag('rejudge')) next.set('callback', function () {
						if (event.judgeResult.color == 'black' && get.position(card, true) == 'o') {
							player.gain(card, 'gain2').gaintag.add('luoshen');
						}
					});
					else next.set('callback', function () {
						if (event.judgeResult.color == 'black') event.getParent().orderingCards.remove(card);
					});
					"step 2"
					if (result.bool) {
						event.cards.push(result.card);
						player.chooseBool('是否再次发动【洛神】？').set('frequentSkill', 'luoshen');
					}
					else {
						for (var i = 0; i < event.cards.length; i++) {
							if (get.position(event.cards[i], true) != 'o') {
								event.cards.splice(i, 1);
								i--;
							}
						}
						if (event.cards.length) {
							player.gain(event.cards, 'gain2').gaintag.add('luoshen');
						}
						event.finish();
					}
					"step 3"
					if (result.bool) {
						event.goto(1);
					}
					else {
						for (var i = 0; i < event.cards.length; i++) {
							if (get.position(event.cards[i], true) != 'o') {
								event.cards.splice(i, 1); i--;
							}
						}
						if (event.cards.length) {
							player.gain(event.cards, 'gain2').gaintag.add('luoshen');
						}
					}
				},
				subSkill: {
					add: {
						mod: {
							ignoredHandcard: function (card, player) {
								if (card.hasGaintag('luoshen')) {
									return true;
								}
							},
							cardDiscardable: function (card, player, name) {
								if (name == 'phaseDiscard' && card.hasGaintag('luoshen')) {
									return false;
								}
							},
						},
						onremove: function (player) {
							player.removeGaintag('luoshen');
						},
					}
				}
			},

			yishi: {
				trigger: {
					global: 'phaseBefore',
					player: 'enterGame',
				},
				audio: 3,
				forced: true,
				locked: true,
				filter: function (event, player) {
					return (event.name != 'phase' || game.phaseNumber == 0) && !player.storage.yishi;
				},
				content: function () {
					'step 0'
					player.chooseTarget('选择一名目标', true, function (card, player, target) {
						if (target == player) return false;
						return true;
					}).set('ai', function (target) {
						if (player.identity == 'zhu') return target;
						if (player.identity == 'zhong') return target.identity == 'zhu';
						if (player.identity == 'nei') return target.identity == 'zhu';
						if (player.identity == 'fan') return target.identity != 'zhu';
					});
					'step 1'
					if (result.bool) {
						player.storage.yishi = result.targets[0];
						result.targets[0].markSkillCharacter('yishi', player, '宜室', '卞夫人的回合改为你的出牌阶段结束后进行');
					}
				},
				group: ['yishi1', 'yishi2', 'yishi3'],
			},
			yishi1: {
				trigger: {
					player: 'phaseBefore',
				},
				filter: function (event, player) {
					if (!game.hasPlayer(function (current) {
						return current == player.storage.yishi;
					})) return false;
					return true;
				},
				content: function () {
					trigger.cancel();
				},
				audio: 'yishi',
				forced: true,
				locked: false,
				ai: {
					expose: 0.2,
					effect: {
						target: function (card, player, target, current) {
							if (get.type(card) == 'delay' && game.hasPlayer(function (current) {
								return current == player.storage.yishi;
							})) return 0;
							return 1;
						}
					}
				},
			},
			yishi2: {
				trigger: {
					global: 'phaseUseEnd',
				},
				filter: function (event, player) {
					if (event.player == player.storage.yishi)
						return true;
					return false;
				},
				content: function () {
					var next1 = player.phaseUse();
					var next2 = player.phaseDiscard();
					trigger.next.push(next1);
					trigger.next.push(next2);
				},
				audio: 'yishi',
				forced: true,
				locked: false,
			},
			yishi3: {
				//赠予部分没写好
			},
			yuejian: {
				audio: 2,
				usable: 1,
				trigger: { global: ['useCardAfter', 'respondAfter'] },
				filter: function (event, player) {
					if (!event.cards[0]) return false;
					return player != event.player && event.targets && get.position(event.cards[0], true) != 'e' && get.position(event.cards[0], true) != 'j' && player.countCards('h') > 0;
				},
				prompt2: function (event, player) {
					var num = get.number(event.card), hs = player.getCards('h'), cards = event.cards.filterInD();
					if ((num < 1 || num > 13 || num == undefined) || !cards.length) {
						return '展示所有手牌，然后无事发生';
					}
					for (var i of hs) {
						if (get.number(i) == num) {
							return '展示所有手牌，然后无事发生';
						}
					}
					return '展示所有手牌，然后<span class="yellowtext">获得' + get.translation(cards) + '</span>';
				},
				check: function (event, player) {
					var num = get.number(event.card), hs = player.getCards('h'), cards = event.cards.filterInD();
					if ((num < 1 || num > 13 || num == undefined) || !cards.length) {
						return false;
					}
					for (var i of hs) {
						if (get.number(i) == num) {
							return false;
						}
					}
					return true;
				},
				content: function () {
					'step 0'
					player.showHandcards(get.translation(player) + '发动了【约俭】');
					var num = get.number(trigger.card), hs = player.getCards('h');
					if ((num < 1 || num > 13 || num == undefined)) { event.finish(); return; }
					for (var i of hs) {
						if (get.number(i) == num) {
							event.finish();
							return;
						}
					}
					'step 1'
					var cards = trigger.cards.filterInD();
					if (cards.length) player.gain(cards, 'gain2');
				},
				ai: {
					threaten: 1.5,
				},
			},

			zhiheng: {
				audio: 2,
				enable: 'phaseUse',
				usable: 1,
				position: 'he',
				filterCard: lib.filter.cardDiscardable,
				discard: false,
				lose: false,
				delay: false,
				selectCard: [1, Infinity],
				check: function (card) {
					var player = _status.event.player;
					if (get.position(card) == 'h' && !player.countCards('h', 'du') && (player.hp > 2 || !player.countCards('h', function (card) {
						return get.value(card) >= 8;
					}))) {
						return 1;
					}
					return 6 - get.value(card)
				},
				content: function () {
					'step 0'
					player.discard(cards);
					event.num = 1;
					var hs = player.getCards('h');
					if (!hs.length) event.num = 0;
					for (var i = 0; i < hs.length; i++) {
						if (!cards.contains(hs[i])) {
							event.num = 0; break;
						}
					}
					'step 1'
					player.draw(event.num + cards.length);
				},
				//group:'rezhiheng_draw',
				ai: {
					order: 1,
					result: {
						player: 1
					},
					threaten: 1.55
				},
			},
			jiuyuan: {
				audio: 'jiuyuan',
				unique: true,
				// alter:true,
				trigger: { target: 'taoBegin' },
				zhuSkill: true,
				forced: true,
				filter: function (event, player) {
					if (get.is.altered('jiuyuan')) return false;
					if (event.player == player) return false;
					if (!player.hasZhuSkill('jiuyuan')) return false;
					if (player.hp > 0) return false;
					if (event.player.group != 'wu') return false;
					return true;
				},
				content: function () {
					player.recover();
				},
				global: 'jiuyuan2',
			},
			jiuyuan2: {
				audio: 'jiuyuan',
				forceaudio: true,
				trigger: { player: 'taoBegin' },
				filter: function (event, player) {
					if (!get.is.altered('jiuyuan')) return false;
					if (player.group != 'wu') return false;
					return game.hasPlayer(function (target) {
						return player != target && target.isDamaged() && target.hp < player.hp && target.hasZhuSkill('jiuyuan', player);
					});
				},
				direct: true,
				content: function () {
					'step 0'
					var list = game.filterPlayer(function (target) {
						return player != target && target.isDamaged() && target.hp < player.hp && target.hasZhuSkill('jiuyuan', player);
					});
					list.sortBySeat();
					event.list = list;
					'step 1'
					if (event.list.length) {
						var current = event.list.shift();
						event.current = current;
						player.chooseBool(get.prompt('jiuyuan', current)).set('choice', get.attitude(player, current) > 0);
					}
					else {
						event.finish();
					}
					'step 2'
					if (result.bool) {
						player.logSkill('jiuyuan', event.current);
						event.current.recover();
						player.draw();
					}
					event.goto(1);
				}
			},

			yingzi: {
				audio: 2,
				audioname: ['lvmeng'],
				trigger: { player: 'phaseDrawBegin2' },
				forced: true,
				preHidden: true,
				filter: function (event, player) {
					return !event.numFixed;
				},
				content: function () {
					trigger.num++;
				},
				ai: {
					threaten: 1.5
				},
				mod: {
					maxHandcardBase: function (player, num) {
						return player.maxHp;
					}
				}
			},
			huoji: {
				position: "hes",
				audio: 2,
				usable: 1,
				enable: "chooseToUse",
				filterCard: function (card) {
					return get.suit(card) == 'heart';
				},
				viewAs: {
					name: "huogong_delay",
				},
				viewAsFilter: function (player) {
					if (!player.countCards('hes', { suit: 'heart' })) return false;
				},
				prompt: "将一张红桃牌当火攻使用",
				check: function (card) {
					var player = _status.currentPhase;
					if (player.countCards('h') > player.hp) {
						return 6 - get.value(card);
					}
					return 4 - get.value(card)
				},
				ai: {
					fireAttack: true,
				},
			},
			fanjian: {
				audio: 2,
				enable: 'phaseUse',
				usable: 1,
				filter: function (event, player) {
					return player.countCards('h') > 0;
				},
				filterTarget: function (card, player, target) {
					return player != target;
				},
				filterCard: true,
				check: function (card) {
					return 8 - get.value(card);
				},
				discard: false,
				lose: false,
				delay: false,
				content: function () {
					"step 0"
					target.storage.refanjian = cards[0];
					target.gain(cards[0], player, 'give');
					"step 1"
					var suit = get.suit(target.storage.refanjian);
					if (!target.countCards('h')) event._result = { control: 'fanjian_hp' };
					else target.chooseControl('fanjian_card', 'fanjian_hp').ai = function (event, player) {
						var cards = player.getCards('he', { suit: get.suit(player.storage.refanjian) });
						if (cards.length == 1) return 0;
						if (cards.length >= 2) {
							for (var i = 0; i < cards.length; i++) {
								if (get.tag(cards[i], 'save')) return 1;
							}
						}
						if (player.hp == 1) return 0;
						for (var i = 0; i < cards.length; i++) {
							if (get.value(cards[i]) >= 8) return 1;
						}
						if (cards.length > 2 && player.hp > 2) return 1;
						if (cards.length > 3) return 1;
						return 0;
					}
					"step 2"
					if (result.control == 'fanjian_card') {
						target.showHandcards();
					}
					else {
						target.loseHp();
						event.finish();
					}
					"step 3"
					var suit = get.suit(target.storage.refanjian);
					target.discard(target.getCards('he', function (i) {
						return get.suit(i) == suit && lib.filter.cardDiscardable(i, target, 'refanjian');
					}));
					delete target.storage.refanjian;
				},
				ai: {
					order: 9,
					result: {
						target: function (player, target) {
							return -target.countCards('he') - (player.countCards('h', 'du') ? 1 : 0);
						}
					},
					threaten: 2,
				}
			},

			kurou: {
				audio: 2,
				enable: 'phaseUse',
				prompt: '失去一点体力并摸两张牌',
				content: function () {
					"step 0"
					player.loseHp(1);
					"step 1"
					player.draw(2);
				},
				ai: {
					basic: {
						order: 1
					},
					result: {
						player: function (player) {
							if (player.countCards('h') >= player.hp - 1) return -1;
							if (player.hp < 3) return -1;
							return 1;
						}
					}
				}
			},
			zhaxiang: {
				unique: true,
				limited: true,
				audio: 2,
				trigger: { player: 'phaseDiscardBefore' },
				filter: function (event, player) {
					return !player.storage.zhaxiang;
				},
				init: function (player) {
					player.storage.zhaxiang = false;
				},
				mark: true,
				intro: {
					content: 'limited'
				},
				skillAnimation: true,
				animationColor: 'wood',
				content: function () {
					player.awakenSkill('zhaxiang');
					player.storage.zhaxiang = true;
					trigger.cancel();
				},
				check:function(event,player){
					if (player.countCards('h') <= player.hp) return false;
							if (player.hp <= 1) return true;
							var cards = player.getCards('h');
							var num = player.countCards('h');
							for (var i = 0; i < cards.length; i++)
								if (get.value(cards[i]) < 5) num--;
							if (num >= 2)
								return true;
							else return false;
				}
			},

			xiying: {
				audio: 2,
				trigger: { player: 'phaseUseBefore' },
				direct: true,
				popup: false,
				content: function () {
					"step 0"
					player.chooseControlList(get.prompt('xiying'), '视为使用一张【过河拆桥】，该【过河拆桥】可指定三个目标', '视为使用一张【趁火打劫】，该【趁火打劫】可指定两个目标', function (event, player) {
						var num = 0;
						for (var i = 0; i < game.players.length; i++) {
							if (get.attitude(player, game.players[i]) < 0 && game.players[i].countCards('h')) num++;
						}
						if (num < 2) return false;
						if (num == 2) return 1;
						if (num > 2 && player.countCards('h') >= 2) return 0;
						return 1;
					});
					"step 1"
					if (result.index == 0) {
						player.logSkill('xiying');
						trigger.cancel();
						player.storage.xiying = 'guohe';
						player.chooseUseTarget({ name: 'guohe' }, 'noTargetDelay', 'nodelayx', 'nodistance');
					}
					else if (result.index == 1) {
						player.logSkill('xiying');
						trigger.cancel();
						player.storage.xiying = 'chenghuo';
						player.chooseUseTarget({ name: 'chenghuodajie' }, 'noTargetDelay', 'nodelayx', 'nodistance');
					}
					'step 2'
					game.delay();
					'step 3'
					delete player.storage.xiying;
				},
				mod: {
					selectTarget: function (card, player, range) {
						if (player.storage.xiying == 'guohe') {
							range[1] += 2;
						}
						else if (player.storage.xiying == 'chenghuo') {
							range[1]++;
						}
					},
				}

			},

			haoshi: {
				audio: 2,
				trigger: { player: 'phaseDrawBegin2' },
				filter: function (event, player) {
					return !event.numFixed;
				},
				preHidden: true,
				check: function (event, player) {
					if (player.countCards('h') <= 1) return true;
					return game.hasPlayer(function (current) {
						return current != player && current.isMinHandcard() && get.attitude(player, current) > 0;
					});
				},
				content: function () {
					trigger.num += 2;
					player.addSkill('haoshi2');
				},
				ai: {
					threaten: 2,
					ai: {
						noh: true,
						skillTagFilter: function (player, tag) {
							if (tag == 'noh') {
								if (player.countCards('h') != 2) return false;
							}
						}
					}
				}
			},
			haoshi2: {
				trigger: { player: 'phaseDrawEnd' },
				forced: true,
				popup: false,
				audio: false,
				content: function () {
					"step 0"
					player.removeSkill('haoshi2');
					if (player.countCards('h') <= 5) {
						event.finish();
						return;
					}
					player.chooseCardTarget({
						selectCard: Math.floor(player.countCards('h') / 2),
						filterTarget: function (card, player, target) {
							return target.isMinHandcard();
						},
						prompt: '将一半的手牌交给场上手牌数最少的一名角色',
						forced: true,
						ai2: function (target) {
							return get.attitude(_status.event.player, target);
						}
					});
					"step 1"
					if (result.targets && result.targets[0]) {
						result.targets[0].gain(result.cards, player, 'giveAuto');
					}
				}
			},
			dimeng: {
				enable: 'phaseUse',
				usable: 1,
				filter: function (event, player) {
					return game.hasPlayer((current) => lib.skill.dimeng.filterTarget(null, player, current));
				},
				selectTarget: 2,
				complexTarget: true,
				filterTarget: function (card, player, target) {
					if (target == player) return false;
					var ps = player.countCards('he');
					if (!ui.selected.targets.length) {
						var hs = target.countCards('h');
						return game.hasPlayer(function (current) {
							if (current == player || current == target) return false;
							var cs = current.countCards('h');
							return (hs > 0 || cs > 0) && Math.abs(hs - cs) <= ps;
						});
					}
					var current = ui.selected.targets[0], hs = target.countCards('h'), cs = current.countCards('h');
					return (hs > 0 || cs > 0) && Math.abs(hs - cs) <= ps;
				},
				multitarget: true,
				multiline: true,
				content: function () {
					targets[0].swapHandcards(targets[1]);
					var num = Math.abs(targets[0].countCards('h') - targets[1].countCards('h'));
					if (num > 0) {
						player.addMark('dimeng_discard', num, false);
						player.addTempSkill('dimeng_discard', 'phaseUseAfter');
					}
				},
				ai: {
					threaten: 4.5,
					pretao: true,
					nokeep: true,
					order: 1,
					expose: 0.2,
					result: {
						target: function (player, target) {
							if (!ui.selected.targets.length) return -Math.sqrt(target.countCards('h'));
							var h1 = ui.selected.targets[0].getCards('h'), h2 = target.getCards('h');
							if (h2.length > h1.length) return 0;
							var delval = get.value(h2, target) - get.value(h1, ui.selected.targets[0]);
							if (delval >= 0) return 0;
							return -delval * (h1.length - h2.length);
						},
					},
				},
				subSkill: {
					discard: {
						trigger: { player: 'phaseUseEnd' },
						forced: true,
						charlotte: true,
						onremove: true,
						filter: function (event, player) {
							return player.countCards('he') > 0;
						},
						content: function () {
							player.chooseToDiscard('he', true, player.countMark('dimeng_discard'));
						},
					},
				},
			},

			keji: {
				audio: 2,
				trigger: { player: 'phaseDiscardBefore' },
				direct: true,
				filter: function (event, player) {
					if (player.getHistory('skipped').contains('phaseUse')) return true;
					var history = player.getHistory('useCard').concat(player.getHistory('respond'));
					for (var i = 0; i < history.length; i++) {
						if (history[i].card.name == 'sha' && history[i].isPhaseUsing()) return false;
					}
					return true;
				},
				content: function () {
					'step 0'
					player.chooseControl('摸两张牌', '跳过弃牌阶段').set('ai', function () {
						if (player.needsToDiscard()) return 1;
						else return 0;
					}).set('prompt', '是否发动克己？');
					'step 1'
					if (result.index == 0) {
						player.draw(2);
						player.logSkill('keji');
					}

					else if (result.index == 1) {
						trigger.cancel();
						player.logSkill('keji');
					}

				}
			},
			qinxue: {
				skillAnimation: true,
				animationColor: 'wood',
				audio: 2,
				unique: true,
				juexingji: true,
				derivation: ['yingzi', 'gongxin'],
				trigger: { player: 'phaseZhunbeiBegin' },
				forced: true,
				filter: function (event, player) {
					if (player.storage.qinxue) return false;
					if (player.countCards('h') >= player.hp + 3) return true;
					if (player.countCards('h') >= player.hp + 2 && game.players.length + game.dead.length >= 7) return true;
					return false;
				},
				content: function () {
					player.storage.qinxue = true;
					player.loseMaxHp();
					player.addSkill(['gongxin', 'yingzi']);
					player.awakenSkill('qinxue');
				}
			},
			gongxin: {
				audio: 2,
				audioname: ['lvmeng', 'gexuan'],
				enable: 'phaseUse',
				usable: 1,
				filterTarget: function (card, player, target) {
					return target != player && target.countCards('h');
				},
				content: function () {
					"step 0"
					event.videoId = lib.status.videoId++;
					var cards = target.getCards('h');
					if (player.isOnline2()) {
						player.send(function (cards, id) {
							ui.create.dialog('攻心', cards).videoId = id;
						}, cards, event.videoId);
					}
					event.dialog = ui.create.dialog('攻心', cards);
					event.dialog.videoId = event.videoId;
					if (!event.isMine()) {
						event.dialog.style.display = 'none';
					}
					player.chooseButton().set('filterButton', function (button) {
						return get.suit(button.link) == 'heart';
					}).set('dialog', event.videoId);
					"step 1"
					if (result.bool) {
						event.card = result.links[0];
						var func = function (card, id) {
							var dialog = get.idDialog(id);
							if (dialog) {
								for (var i = 0; i < dialog.buttons.length; i++) {
									if (dialog.buttons[i].link == card) {
										dialog.buttons[i].classList.add('selectedx');
									}
									else {
										dialog.buttons[i].classList.add('unselectable');
									}
								}
							}
						}
						if (player.isOnline2()) {
							player.send(func, event.card, event.videoId);
						}
						else if (event.isMine()) {
							func(event.card, event.videoId);
						}
						player.chooseControl('gongxin_discard', 'gongxin_top');
					}
					else {
						if (player.isOnline2()) {
							player.send('closeDialog', event.videoId);
						}
						event.dialog.close();
						event.finish();
					}
					"step 2"
					if (player.isOnline2()) {
						player.send('closeDialog', event.videoId);
					}
					event.dialog.close();
					var card = event.card;
					if (result.control == 'gongxin_top') {
						player.showCards(card, '置于牌堆顶');
						target.lose(card, ui.cardPile, 'insert', 'visible');
						game.log(player, '将', event.card, '置于牌堆顶');
					}
					else {
						target.discard(card);
					}
				},
				ai: {
					threaten: 1.5,
					result: {
						target: function (player, target) {
							return -target.countCards('h');
						}
					},
					order: 10,
					expose: 0.4,
				}
			},

			qianxun: {
				init: function (player) {
					if (!player.storage.qianxun2) player.storage.qianxun2 = [];
				},
				audio: 2,
				trigger: { target: 'useCardToBegin', player: 'judgeBefore' },
				filter: function (event, player) {
					if (player.countCards('h') == 0) return false;
					if (event.parent.name == 'phaseJudge') {
						if (lib.skill.qianxun.trigger.player == 'judgeBefore'&&event.card&&get.type(event.card,'trick')=='trick') {
							return true;
						}
						return event.result && event.result.judge != 0;
					}
					if (event.name == 'judge') return false;
					if (event.targets && event.targets.length > 1) return false;
					if (event.card && get.type(event.card) == 'trick' && event.player != player) return true;
				},
				content: function () {
					player.storage.qianxun2 = player.storage.qianxun2.concat(player.getCards('h'));
					game.addVideo('storage', player, ['qianxun2', get.cardsInfo(player.storage.qianxun2), 'cards']);
					player.lose(player.getCards('h'), ui.special, 'toStorage');
					player.addSkill('qianxun2');
				},
				ai: {
					effect: function (card, player, target) {
						if (!target.hasFriend()) return;
						if (player == target) return;
						var type = get.type(card);
						var nh = target.countCards();
						if (type == 'trick') {
							if (!get.tag(card, 'multitarget') || get.info(card).singleCard) {
								if (get.tag(card, 'damage')) {
									if (nh < 3 || target.hp <= 2) return 0.8;
								}
								return [1, nh];
							}
						}
						else if (type == 'delay') {
							return [0.5, 0.5];
						}
					},
				}
			},
			qianxun2: {
				trigger: { global: 'phaseEnd' },
				forced: true,
				audio: false,
				content: function () {
					player.gain(player.storage.qianxun2, 'fromStorage', 'draw');
					player.storage.qianxun2.length = 0;
					player.removeSkill('qianxun2');
					game.addVideo('storage', player, ['qianxun2', get.cardsInfo(player.storage.qianxun2), 'cards']);
				},
				mark: true,
				intro: {
					content: 'cardCount',
					onunmark: function (storage, player) {
						if (storage && storage.length) {
							player.$throw(storage, 1000);
							game.cardsDiscard(storage);
							game.log(storage, '被置入了弃牌堆');
							player.storage.qianxun2.length = 0;
						}
					},
				}
			},
			lianying: {
				audio: 2,
				trigger: {
					player: 'loseAfter',
					global: ['equipAfter', 'addJudgeAfter', 'gainAfter', 'loseAsyncAfter'],
				},
				direct: true,
				filter: function (event, player) {
					if (player.countCards('h')) return false;
					var evt = event.getl(player);
					return evt && evt.hs && evt.hs.length;
				},
				content: function () {
					"step 0"
					var num = trigger.getl(player).hs.length;
					player.chooseTarget(get.prompt('lianying'), '令至多' + get.cnNumber(num) + '名角色各摸一张牌', [1, num]).ai = function (target) {
						var player = _status.event.player;
						if (player == target) return get.attitude(player, target) + 10;
						return get.attitude(player, target);
					}
					"step 1"
					if (result.bool) {
						player.logSkill('lianying', result.targets);
						game.asyncDraw(result.targets);
					}
					else event.finish();
					"step 2"
					game.delay();
				},
				ai: {
					threaten: 0.8,
					effect: {
						target: function (card) {
							if (card.name == 'guohe' || card.name == 'liuxinghuoyu') return 0.5;
						}
					},
					noh: true,
				}
			},

			jianying:{
				audio:2,
				enable:'phaseUse',
				usable:1,
				filter: function (event, player) {
					return player.countCards('hes',{type:'equip'})&&game.hasPlayer(function (current) {
						return  player.canUse({ name: 'sha' }, current, false);
					});
				},
				filterTarget:function(card,player,target){
					return player.canUse({ name: 'sha' }, target, false);
				},
				filterCard:function(card){
					return get.type(card)=='equip';
				},
				discard: false,
				lose: false,
				delay: 0,
				selectCard: 1,
				position: 'hes',
				content:function(){
					player.useCard({name:'sha'},target,cards).audio=false;
				},
				ai:{
					basic:{
						order:10
					},
					result:{
						target:function(player,target){
							var eff=get.effect(target,{name:'sha'},player,target);
							var damageEff=get.damageEffect(target,player,player);
							if(eff>0) return damageEff>0?0:eff;
							if(target.hasSkill('bagua_skill')||target.hasSkill('rw_bagua_skill')||target.hasSkill('bazhen')) return 0;
							return eff;
						},
					},
					threaten:1.4
				}
			},
			gongzhi:{
				shaRelated:true,
				audio:2,
				forced:true,
				trigger:{player:'useCardToPlayered'},
				filter:function(event,player){
					return event.card.name=='sha'&&get.distance(player,event.target,'attack')>1;
				},
				logTarget:'target',
				content:function(){
					trigger.getParent().directHit.add(trigger.target);
				},
				ai:{
					threaten:1.4,
				}
			},
			/*gongzhi: {
				audio: 2,
				locked: true,
				forced: true,
				trigger: { player: 'useCard1' },
				group: ['gongzhi1', 'gongzhi2','gongzhi3'],
				filter: function (event, player) {
					return !event.audioed && event.card.name == 'sha' && player.countUsed('sha', true) == 1 && _status.currentPhase==player;
				},
				content: function () {
					trigger.audioed = true;
				},
				mod: {
					targetInRange: function (card, player, target, now) {
						if (player.countUsed('sha', true) == 0 && card.name == 'sha') {
							return true;
						}
					},
				}
			},
			gongzhi1: {
				audio: 'gongzhi',
				forced: true,
				trigger: { source: 'damageBegin1' },
				filter: function (event, player) {
					return event.card && event.card.name == 'sha' && player.countUsed('sha', true) == 2 && _status.currentPhase==player && event.notLink();
				},
				content: function () {
					trigger.num++;
				},
			},
			gongzhi2: {
				audio: 'gongzhi',
				forced: true,
				trigger: { player: 'useCardToPlayered' },
				filter: function (event, player) {
					return event.card && event.card.name == 'sha' && player.countUsed('sha', true) == 3 && _status.currentPhase==player;
				},
				content: function () {
					trigger.getParent().directHit.add(trigger.target);
				},
			},
			gongzhi3: {
				equipSkill: true,
				audio:'gongzhi',
				trigger: { player: 'shaMiss' },
				direct: true,
				filter: function (event, player) {
					return player.canUse('sha', event.target, false) && (player.hasSha() || _status.connectMode && player.countCards('h'));
				},
				content: function () {
					"step 0"
					player.chooseToUse('可以对其再次使用一张杀', function (card, player, event) {
						if (get.name(card) != 'sha') return false;
						return lib.filter.filterCard.apply(this, arguments);
					}, trigger.target, -1).set('addCount', false).logSkill = 'gongzhi';
				},
			},*/
			xiaoji: {
				audio: 2,
				locked: true,
				forced: true,
				audioname: ['sp_sunshangxiang', 're_sunshangxiang'],
				trigger: {
					player: 'loseAfter',
					global: ['equipAfter', 'addJudgeAfter', 'gainAfter', 'loseAsyncAfter'],
				},
				filter: function (event, player) {
					var evt = event.getl(player);
					return evt && evt.player == player && evt.es && evt.es.length > 0;
				},
				content: function () {
					player.draw(2);
				},
				ai: {
					noe: true,
					reverseEquip: true,
					effect: {
						target: function (card, player, target, current) {
							if (get.type(card) == 'equip' && !get.cardtag(card, 'gifts')) return [1, 2];
						}
					}
				}
			},

			guose: {
				audio: 2,
				usable: 1,
				group: 'guose1',
				filter: function (event, player) {
					return player.countCards('hes', { suit: 'diamond' }) > 0;
				},
				enable: 'chooseToUse',
				filterCard: function (card) {
					return get.suit(card) == 'diamond';
				},
				position: 'hes',
				viewAs: { name: 'lebu' },
				prompt: '将一张方片牌当乐不思蜀使用',
				check: function (card) { return 6 - get.value(card) },
				ai: {
					threaten: 1.5
				}
			},
			guose1: {
				audio: 'guose',
				trigger: { global: 'judge' },
				direct: true,
				preHidden: true,
				filter: function (event, player) {
					return player.countCards(get.mode() == 'guozhan' ? 'hes' : 'hs') > 0;
				},
				content: function () {
					"step 0"
					player.chooseCard(get.translation(trigger.player) + '的' + (trigger.judgestr || '') + '判定为' +
						get.translation(trigger.player.judging[0]) + '，' + get.prompt('guose'), get.mode() == 'guozhan' ? 'hes' : 'hs', function (card) {
							if (get.suit(card) != 'diamond') return false;
							var player = _status.event.player;
							var mod2 = game.checkMod(card, player, 'unchanged', 'cardEnabled2', player);
							if (mod2 != 'unchanged') return mod2;
							var mod = game.checkMod(card, player, 'unchanged', 'cardRespondable', player);
							if (mod != 'unchanged') return mod;
							return true;
						}).set('ai', function (card) {
							var trigger = _status.event.getTrigger();
							var player = _status.event.player;
							var judging = _status.event.judging;
							var result = trigger.judge({name:card.name,suit:card.suit,number:card.number}) - trigger.judge(judging);
							var attitude = get.attitude(player, trigger.player);
							if (attitude == 0 || result == 0) return 0;
							if (attitude > 0) {
								return result - get.value(card) / 2;
							}
							else {
								return -result - get.value(card) / 2;
							}
						}).set('judging', trigger.player.judging[0]).setHiddenSkill('guose');
					"step 1"
					if (result.bool) {
						player.respond(result.cards, 'guose', 'highlight', 'noOrdering').set('time',500);
					}
					else {
						event.finish();
					}
					"step 2"
					if (result.bool) {
						if (trigger.player.judging[0].clone) {
							trigger.player.judging[0].clone.classList.remove('thrownhighlight');
							game.broadcast(function (card) {
								if (card.clone) {
									card.clone.classList.remove('thrownhighlight');
								}
							}, trigger.player.judging[0]);
							game.addVideo('deletenode', player, get.cardsInfo([trigger.player.judging[0].clone]));
						}
						game.cardsDiscard(trigger.player.judging[0]);
						trigger.player.judging[0] = result.cards[0];
						game.log(trigger.player, '的判定牌改为', result.cards[0]);
						game.delay();
					}
					else event.finish();
					'step 3'
					game.broadcastAll(function (player, card, cardid) {
						var event;
						if (game.online) {
							event = {};
						}
						else {
							event = _status.event;
						}
						if (game.chess) {
							event.node = card.copy('thrown', 'center', ui.arena).animate('start');
						}
						else {
							event.node = player.$throwordered(card.copy(), true);
						}
						if (lib.cardOL) lib.cardOL[cardid] = event.node;
						event.node.cardid = cardid;
						event.node.classList.add('thrownhighlight');
						ui.arena.classList.add('thrownhighlight');
					}, player, result.cards[0], get.id());
					trigger.node=event.node;
				},
				ai: {
					rejudge: true,
					tag: {
						rejudge: 1,
					}
				}
			},
			yayun: {
				audio: 2,
				mod: {
					suit: function (card, suit) {
						if (suit == 'club') return 'diamond';
					},
				},
			},
			shenghua: {
				trigger: { global: 'judgeEnd' },
				preHidden: true,
				direct: true,
				usable: 1,
				filter: function (event, player) {
					return get.color(event.result.card) == 'red';
				},
				content: function () {
					'step 0'
					event.list = [];
					event.list.push('摸一张牌');
					if (trigger.player.maxHp != trigger.player.hp) event.list.push('回复1点极星体力');
					event.list.push('cancel2');
					player.chooseControl(event.list).set('prompt', '是否发动【生花】？').set('ai', function () {
						if (get.attitude(player, trigger.player) < 0) return 'cancel2';
						if (trigger.player.maxHp == trigger.player.hp) return '摸一张牌';
						return '回复1点极星体力';
					});
					'step 1'
					if (result.control == '回复1点极星体力') {
						player.logSkill('shenghua');
						trigger.player.recover(1, 'star');
					}
					else if (result.control == '摸一张牌') {
						player.logSkill('shenghua');
						trigger.player.draw();
					}
				}
			},

			tianxiang: {
				audio: 2,
				trigger: { player: 'damageBegin4' },
				direct: true,
				filter: function (event, player) {
					return player.countCards('he', function (card) {
						if (_status.connectMode && get.position(card) == 'h') return true;
						return get.suit(card, player) == 'heart';
					}) > 0 && event.num > 0;
				},
				content: function () {
					"step 0"
					player.chooseCardTarget({
						filterCard: function (card, player) {
							return get.suit(card) == 'heart' && lib.filter.cardDiscardable(card, player);
						},
						filterTarget: function (card, player, target) {
							return player != target;
						},
						position: 'he',
						ai1: function (card) {
							return 10 - get.value(card);
						},
						ai2: function (target) {
							var att = get.attitude(_status.event.player, target);
							var trigger = _status.event.getTrigger();
							var da = 0;
							if (_status.event.player.hp == 1) {
								da = 10;
							}
							var eff = get.damageEffect(target, trigger.source, target);
							if (att == 0) return 0.1 + da;
							if (eff >= 0 && att > 0) {
								return att + da;
							}
							if (att > 0 && target.hp > 1) {
								if (target.maxHp - target.hp >= 3) return att * 1.1 + da;
								if (target.maxHp - target.hp >= 2) return att * 0.9 + da;
							}
							return -att + da;
						},
						prompt: get.prompt('tianxiang'),
						prompt2: lib.translate.tianxiang_info
					});
					"step 1"
					if (result.bool) {
						player.discard(result.cards);
						var target = result.targets[0];
						player.chooseControlList(true, function (event, player) {
							var target = _status.event.target;
							var att = get.attitude(player, target);
							if (target.hasSkillTag('maihp')) att = -att;
							if (att > 0) {
								return 0;
							}
							else {
								return 1;
							}
						},
							['令' + get.translation(target) + '受到伤害来源对其造成的1点伤害，然后摸X张牌（X为其已损失体力值且至多为5）',
							'令' + get.translation(target) + '失去1点体力，然后获得' + get.translation(result.cards)]).set('target', target);
						player.logSkill(event.name, target);
						trigger.cancel();
						event.target = target;
						event.card = result.cards[0];
					}
					else {
						event.finish();
					}
					"step 2"
					if (typeof result.index == 'number') {
						event.index = result.index;
						if (result.index) {
							event.related = event.target.loseHp();
						}
						else {
							event.related = event.target.damage(trigger.source || 'nosource', 'nocard');
						}
					}
					else event.finish();
					"step 3"
					if (event.related.cancelled || target.isDead()) return;
					if (event.index && card.isInPile()) target.gain(card, 'gain2');
					else if (target.getDamagedHp()) target.draw(Math.min(5, target.getDamagedHp()));
				},
				ai: {
					maixie_defend: true,
					effect: {
						target: function (card, player, target) {
							if (player.hasSkillTag('jueqing', false, target)) return;
							if (get.tag(card, 'damage') && target.countCards('he') > 1) return 0.7;
						}
					},
				}
			},
			hongyan: {
				audio: 2,
				mod: {
					suit: function (card, suit) {
						if (suit == 'spade') return 'heart';
					},
				},
			},
			piaoling: {
				audio: 2,
				trigger: { player: 'phaseJieshuBegin' },
				frequent: true,
				content: function () {
					'step 0'
					player.judge(function (card) {
						return get.suit(card) == 'heart' ? 2 : 0;
					}).judge2 = function (result) {
						return result.bool ? true : false;
					};
					'step 1'
					event.card = result.card;
					if (result.bool && get.position(event.card, true) == 'd') {
						player.chooseTarget('令一名角色获得' + get.translation(event.card) + '，或点【取消】将其置于牌堆顶').set('ai', function (target) {
							var player = _status.event.player;
							var att = get.attitude(player, target);
							if (player == target) att /= 2;
							return att;
						});
					}
					else event.finish();
					'step 2'
					if (result.targets && result.targets.length) {
						var target = result.targets[0];
						player.line(target, 'green');
						target.gain(card, 'gain2', 'log');
						if (player == target) player.chooseToDiscard('he', true);
					}
					else {
						card.fix();
						ui.cardPile.insertBefore(card, ui.cardPile.firstChild);
						game.updateRoundNumber();
					}
				},
			},

			leiji: {
				audio: 2,
				audioname: ['boss_qinglong'],
				trigger: { player: ['useCard', 'respond'] },
				filter: function (event, player) {
					return event.card.name == 'shan';
				},
				direct: true,
				content: function () {
					"step 0";
					player.chooseTarget(get.prompt2('leiji'), function (card, player, target) {
						return target != player;
					}).ai = function (target) {
						if (target.hasSkill('hongyan')) return 0;
						return get.damageEffect(target, _status.event.player, _status.event.player, 'thunder');
					};
					"step 1"
					if (result.bool) {
						player.logSkill('leiji', result.targets, 'thunder');
						event.target = result.targets[0];
						event.target.judge(function (card) {
							var suit = get.suit(card);
							if (suit == 'spade') return -4;
							if (suit == 'club') return -2;
							return 0;
						}).judge2 = function (result) {
							return result.bool == false ? true : false;
						};
					}
					else {
						event.finish();
					}
					"step 2"
					if (result.suit == 'club') {
						event.target.damage('thunder');
						player.recover();
					}
					else if (result.suit == 'spade') {
						event.target.damage(2, 'thunder');
					}
				},
				ai: {
					useShan: true,
					effect: {
						target: function (card, player, target, current) {
							if (get.tag(card, 'respondShan')) {
								var hastarget = game.hasPlayer(function (current) {
									return get.attitude(target, current) < 0;
								});
								var be = target.countCards('e', { color: 'black' });
								if (target.countCards('h', 'shan') && be) {
									if (!target.hasSkill('guidao')) return 0;
									return [0, hastarget ? target.countCards('he') / 2 : 0];
								}
								if (target.countCards('h', 'shan') && target.countCards('h') > 2) {
									if (!target.hasSkill('guidao')) return 0;
									return [0, hastarget ? target.countCards('h') / 4 : 0];
								}
								if (target.countCards('h') > 3 || (be && target.countCards('h') >= 2)) {
									return [0, 0];
								}
								if (target.countCards('h') == 0) {
									return [1.5, 0];
								}
								if (target.countCards('h') == 1 && !be) {
									return [1.2, 0];
								}
								if (!target.hasSkill('guidao')) return [1, 0.05];
								return [1, Math.min(0.5, (target.countCards('h') + be) / 4)];
							}
						}
					}
				}
			},
			guidao: {
				audio: 2,
				trigger: { global: 'judge' },
				filter: function (event, player) {
					return player.countCards('hes', { color: 'black' }) > 0&&!player.hasSkill('guidao2');
				},
				direct: true,
				content: function () {
					"step 0"
					player.chooseCard(get.translation(trigger.player) + '的' + (trigger.judgestr || '') + '判定为' +
						get.translation(trigger.player.judging[0]) + '，' + get.prompt('guidao'), 'hes', function (card) {
							if (get.color(card) != 'black') return false;
							var player = _status.event.player;
							var mod2 = game.checkMod(card, player, 'unchanged', 'cardEnabled2', player);
							if (mod2 != 'unchanged') return mod2;
							var mod = game.checkMod(card, player, 'unchanged', 'cardRespondable', player);
							if (mod != 'unchanged') return mod;
							return true;
						}).set('ai', function (card) {
							var trigger = _status.event.getTrigger();
							var player = _status.event.player;
							var judging = _status.event.judging;
							var result = trigger.judge(card) - trigger.judge(judging);
							var attitude = get.attitude(player, trigger.player);
							if (attitude == 0 || result == 0) return 0;
							if (attitude > 0) {
								return result;
							}
							else {
								return -result;
							}
						}).set('judging', trigger.player.judging[0]);
					"step 1"
					if (result.bool) {
						player.respond(result.cards, 'highlight', 'guidao', 'noOrdering').set('time',500);
					}
					else {
						event.finish();
					}
					"step 2"
					if (result.bool) {
						player.$gain2(trigger.player.judging[0]);
						player.gain(trigger.player.judging[0]);
						trigger.player.judging[0] = result.cards[0];
						trigger.orderingCards.addArray(result.cards);
						player.addTempSkill('guidao2');
						game.log(trigger.player, '的判定牌改为', result.cards[0]);
						game.delay();
					}
					else event.finish();
					"step 3"
					game.broadcastAll(function (player, card, cardid) {
							var event;
							if (game.online) {
								event = {};
							}
							else {
								event = _status.event;
							}
							if (game.chess) {
								event.node = card.copy('thrown', 'center', ui.arena).animate('start');
							}
							else {
								event.node = player.$throwordered(card.copy(), true);
							}
							if (lib.cardOL) lib.cardOL[cardid] = event.node;
							event.node.cardid = cardid;
							event.node.classList.add('thrownhighlight');
							ui.arena.classList.add('thrownhighlight');
						}, player, result.cards[0], get.id());
						trigger.node=event.node;
				},
				ai: {
					rejudge: true,
					tag: {
						rejudge: 1
					}
				}
			},
			guidao2:{},
			huangtian: {
				unique: true,
				audio: 'huangtian2',
				audioname: ['zhangjiao', 're_zhangjiao'],
				global: 'huangtian2',
				zhuSkill: true,
			},
			huangtian2: {
				audio: 2,
				enable: 'phaseUse',
				discard: false,
				lose: false,
				delay: false,
				line: true,
				direct: true,
				clearTime: true,
				prepare: function (cards, player, targets) {
					targets[0].logSkill('huangtian');
				},
				prompt: function () {
					var player = _status.event.player;
					var list = game.filterPlayer(function (target) {
						return target != player && target.hasZhuSkill('huangtian', player);
					});
					var str = '将一张【闪】或【闪电】交给' + get.translation(list);
					if (list.length > 1) str += '中的一人';
					return str;
				},
				filter: function (event, player) {
					if (player.group != 'qun') return false;
					if (player.countCards('h', 'shan') + player.countCards('h', 'shandian') == 0) return 0;
					return game.hasPlayer(function (target) {
						return target != player && target.hasZhuSkill('huangtian', player) && !target.hasSkill('huangtian3');
					});
				},
				filterCard: function (card) {
					return (card.name == 'shan' || card.name == 'shandian')
				},
				log: false,
				visible: true,
				filterTarget: function (card, player, target) {
					return target != player && target.hasZhuSkill('huangtian', player) && !target.hasSkill('huangtian3');
				},
				//usable:1,
				//forceaudio:true,
				content: function () {
					target.gain(cards, player, 'giveAuto');
					target.addTempSkill('huangtian3', 'phaseUseEnd');
				},
				ai: {
					expose: 0.3,
					order: 10,
					result: {
						target: 5
					}
				}
			},
			huangtian3: {},

			wushuang: {
				shaRelated: true,
				audio: 2,
				forced: true,
				locked: true,
				group: ['wushuang1', 'wushuang2'],
				preHidden: ['wushuang1', 'wushuang2'],
			},
			wushuang1: {
				audio: 'wushuang',
				trigger: { player: 'useCardToPlayered' },
				forced: true,
				filter: function (event, player) {
					return event.card.name == 'sha' && !event.getParent().directHit.contains(event.target);
				},
				//priority:-1,
				logTarget: 'target',
				content: function () {
					var id = trigger.target.playerid;
					var map = trigger.getParent().customArgs;
					if (!map[id]) map[id] = {};
					if (typeof map[id].shanRequired == 'number') {
						map[id].shanRequired++;
					}
					else {
						map[id].shanRequired = 2;
					}
				},
				ai: {
					directHit_ai: true,
					skillTagFilter: function (player, tag, arg) {
						if (arg.card.name != 'sha' || arg.target.countCards('h', 'shan') > 1) return false;
					},
				},
			},
			wushuang2: {
				audio: 'wushuang',
				trigger: { player: 'useCardToPlayered', target: 'useCardToTargeted' },
				forced: true,
				logTarget: function (trigger, player) {
					return player == trigger.player ? trigger.target : trigger.player
				},
				filter: function (event, player) {
					return event.card.name == 'juedou';
				},
				//priority:-1,
				content: function () {
					var id = (player == trigger.player ? trigger.target : trigger.player)['playerid'];
					var idt = trigger.target.playerid;
					var map = trigger.getParent().customArgs;
					if (!map[idt]) map[idt] = {};
					if (!map[idt].shaReq) map[idt].shaReq = {};
					if (!map[idt].shaReq[id]) map[idt].shaReq[id] = 1;
					map[idt].shaReq[id]++;
				},
				ai: {
					directHit_ai: true,
					skillTagFilter: function (player, tag, arg) {
						if (arg.card.name != 'juedou' || Math.floor(arg.target.countCards('h', 'sha') / 2) > player.countCards('h', 'sha')) return false;
					}
				}
			},
			yongzhan: {
				unique: true,
				limited: true,
				audio: 2,
				enable: 'phaseUse',
				selectTarget: [1, 3],
				filter: function (event, player) {
					return !player.storage.yongzhan;
				},
				init: function (player) {
					player.storage.yongzhan = false;
				},
				filterTarget: function (card, player, target) {
					return player != target&&player.canUse('juedou', target);
				},
				mark: true,
				intro: {
					content: 'limited'
				},
				skillAnimation: true,
				animationColor: 'thunder',
				precontent: function () {
					player.awakenSkill('yongzhan');
					player.storage.yongzhan = true;
					player.turnOver();
				},
				content: function () {
					player.useCard({ name: 'juedou' }, target, false);
				},
				ai: {
					order: 16,
					result: {
						target: function (player, target) {
							var eff=get.effect(target,{name:'juedou'},player,target);
							var damageEff=get.damageEffect(target,player,player);
							if(eff>0) return damageEff>0?0:eff;
							return eff;
						},
					}
				}
			},

			dumou: {
				locked: true,
				audio: 2,
				global: 'dumou2',
				forced: true,
				preHidden: true,
				ai: {
					threaten: 1.5,
				}
			},
			dumou2: {
				audio: 2,
				mod: {
					cardname: function (card, player, name) {
						if (!_status.currentPhase) return;
						if (_status.currentPhase.isAlive() && _status.currentPhase.hasSkill('dumou') && _status.currentPhase != player) {
							if (get.color(card) == 'black') return 'du';
						}
						if (_status.currentPhase.isAlive() && _status.currentPhase.hasSkill('dumou') && _status.currentPhase == player) {
							if (card.name == 'du') return 'guohe';
						}
					},
				},
			},
			mieji: {
				audio: 2,
				enable: 'phaseUse',
				usable: 1,
				filter: function (event, player) {
					return player.countCards('h', { color: 'black' });
				},
				filterCard: function (card) {
					return get.color(card) == 'black';
				},
				filterTarget: function (card, player, target) {
					return target != player && target.countCards('h') > 0;
				},
				discard: false,
				delay: false,
				check: function (card) {
					return 8 - get.value(card);
				},
				loseTo: 'cardPile',
				insert: true,
				visible: true,
				content: function () {
					'step 0'
					player.showCards(cards);
					'step 1'
					target.chooseToDiscard('he', true).set('prompt', '请弃置一张锦囊牌，或依次弃置两张非锦囊牌。');
					'step 2'
					if ((!result.cards || get.type(result.cards[0], 'trick', result.cards[0].original == 'h' ? target : false) != 'trick') && target.countCards('he', function (card) {
						return get.type(card, 'trick') != 'trick';
					})) {
						target.chooseToDiscard('he', true, function (card) {
							return get.type(card, 'trick') != 'trick';
						}).set('prompt', '请弃置第二张非锦囊牌');
					}
				},
				ai: {
					order: 9,
					result: {
						target: -1
					}
				}
			},

			yicong: {
				audio: 4,
				trigger: { player: 'phaseBegin' },
				locked: true,
				forced: true,
				filter: function (event, player) {
					return player.storage.disableEquip != undefined && player.storage.disableEquip.length < 5;
				},
				group: ['yicong1', 'yicong2'],
				content: function () {
					'step 0'
					player.chooseToDisable(true).set('ai', function (event, player, list) {
						if (list.contains('equip6')) return 'equip6';
						if (list.contains('equip1')) return 'equip1';
						if (list.contains('equip5')) return 'equip5';
						if (list.contains('equip2')) return 'equip2';
					});
					'step 1'
					if (result.control == 'equip1') {
						player.draw(2);
					};
					if (result.control == 'equip2') {
						player.draw(2);
					};
					if (result.control == 'equip6') {
						player.draw(2);
					};
					if (result.control == 'equip5') {
						player.draw(2);
					};
					'step 2'
					if (player.storage.yicong1 == 2) {
						event.num = 2;
						event.goto(3);
					}
					else if (player.storage.yicong2 == 2) {
						event.num = 1;
						event.goto(3);
					}
					else {
						var list = [];
						list.push('你计算与其他角色的距离-1');
						list.push('其他角色计算与你的距离+1');
						player.chooseControlList('你选择一项', list, true, function (event, player) {
							if (player.identity == 'zhu') return 1;
							if (player.hp > 2 && game.hasPlayer(function (current) {
								return get.distance(player, current) > 1;
							})) return 0;
							return 1;
						});
					}
					'step 3'
					if (result.index == 0 || event.num == 1) {
						if (!player.storage.yicong1) player.storage.yicong1 = 0;
						player.storage.yicong1++;
					}
					else if (result.index == 1 || event.num == 2) {
						if (!player.storage.yicong2) player.storage.yicong2 = 0;
						player.storage.yicong2++;
					}
					if (player.storage.disableEquip.length == 5) player.addSkill('yicong3');
				},
				ai: {
					order: 13,
					result: {
						player: function (player) {
							if (!player.isDisabled('equip2')) return 1;
							if (!player.isDisabled('equip1') && (player.countCards('h', function (card) {
								return get.name(card, player) == 'sha' && player.hasValueTarget(card);
							}) - player.getCardUsable('sha')) > 1) return 1;
							if (!player.isDisabled('equip5') && player.countCards('h', function (card) {
								return get.type2(card, player) == 'trick' && player.hasUseTarget(card);
							}) > 1) return 1;
							return -1;
						},
					},
				},
			},
			yicong1: {
				mod: {
					globalFrom: function (from, to, distance) {
						if (from.storage.yicong1)
							return distance - from.storage.yicong1;
						else
							return distance;
					}
				}
			},
			yicong2: {
				mod: {
					globalTo: function (from, to, distance) {
						if (to.storage.yicong2)
							return distance + to.storage.yicong2;
						else
							return distance;
					}
				}
			},
			yicong3: {
				audio: 'yicong',
				mod: {
					cardname: function (card, player, name) {
						if (get.subtypeorigin(card) == 'equip1') return 'sha';
						if (get.subtypeorigin(card) == 'equip2') return 'shan';
						if (get.subtypeorigin(card) == 'equip3') return 'jiu';
						if (get.subtypeorigin(card) == 'equip4') return 'jiu';
						if (get.subtypeorigin(card) == 'equip5') return 'tao';
					},
				},
			},

			jijiu: {
				mod: {
					aiValue: function (player, card, num) {
						if (get.name(card) != 'tao' && get.color(card) != 'red') return;
						var cards = player.getCards('hs', function (card) {
							return get.name(card) == 'tao' || get.color(card) == 'red';
						});
						cards.sort(function (a, b) {
							return (get.name(a) == 'tao' ? 1 : 2) - (get.name(b) == 'tao' ? 1 : 2);
						});
						var geti = function () {
							if (cards.contains(card)) {
								return cards.indexOf(card);
							}
							return cards.length;
						};
						return Math.max(num, [6.5, 4, 3, 2][Math.min(geti(), 2)]);
					},
					aiUseful: function () {
						return lib.skill.jijiu.mod.aiValue.apply(this, arguments);
					},
				},
				locked: false,
				audio: 2,
				enable: 'chooseToUse',
				viewAsFilter: function (player) {
					return player != _status.currentPhase && player.countCards('hes', { color: 'red' }) > 0;
				},
				filterCard: function (card) {
					return get.color(card) == 'red';
				},
				position: 'hes',
				viewAs: { name: 'tao' },
				prompt: '将一张红色牌当桃使用',
				check: function (card) { return 15 - get.value(card) },
				ai: {
					threaten: 1.5,
				}
			},
			qingnang: {
				audio: 2,
				usable: 1,
				enable: 'phaseUse',
				filter: function (event, player) {
					return player.countCards('h');
				},
				chooseButton: {
					dialog: function (event, player) {
						return ui.create.dialog('###青囊###' + '选择【刮骨疗毒】的使用方式');
					},
					chooseControl: function (event, player) {
						var list = [];
						list.push('使用');
						list.push('延迟使用');
						list.push('cancel2');
						return list;
					},
					check: function (event, player) {
						if (!game.hasPlayer(function (current) {
							return current.maxHp == current.hp;
						})) return 1;
						return 0;
					},
					backup: function (links, player) {
						return {
							filterCard: false,
							selectCard: 1,
							viewAs: function (cards, player) {
								var name = null;
								if (links.index == 0) name = 'guaguliaodu';
								else if (links.index == 1) name = 'guagu_delay';
								if (name) return { name: name };
								return null;
							},

							onuse: function (result, player) {
								player.logSkill('qingnang');
							}
						}
					},
					prompt: function (links, player) {
						return '请选择' + get.translation(links.name) + '的目标';
					}
				},
				ai: {
					order: 10,
					result: {
						player: function (player) {
							return 10;
						}
					},
					threaten: 1.4,
				}
			},

			mingce: {},
			zhichi: {
				audio: 2,
				trigger: { player: 'damageEnd' },
				forced: true,
				filter: function (event, player) {
					return _status.currentPhase != player;
				},
				content: function () {
					player.addTempSkill('zhichi2', ['phaseAfter', 'phaseBefore']);
				}
			},
			zhichi2: {
				trigger: { target: 'useCardToBefore' },
				forced: true,
				priority: 15,
				filter: function (event, player) {
					return get.type(event.card) == 'trick' || event.card.name == 'sha';
				},
				content: function () {
					game.log(player, '发动了智迟，', trigger.card, '对', trigger.target, '失效')
					trigger.cancel();
				},
				mark: true,
				intro: {
					content: '杀或普通锦囊牌对你无效'
				},
				ai: {
					effect: {
						target: function (card, player, target, current) {
							if (get.type(card) == 'trick' || card.name == 'sha') return 'zeroplayertarget';
						}
					}
				}
			},

			zhaosong: {
				trigger: { global: ['phaseDrawAfter'] },
				filter: function (event, player) {
					if (player == event.player || !event.player.countCards('h')) return false;
					var list = lib.inpile.filter(function (i) {
						if (player.storage.zhaosong.contains(i)) return false;
						if (i == 'menghun' || i == 'wuxie' || i == 'du' || i == 'shan') return false;
						var type = get.type(i);
						if (type == 'basic' || type == 'trick') return true;
						return false;
					});
					if (!list.length) return false;
					return true;
				},
				init: function (player) {
					if (!player.storage.zhaosong) player.storage.zhaosong = [];
				},
				check: function (event, player) {
					var num = 0;
					for (var i = 0; i < lib.inpile.length; i++) {
						if (player.storage.zhaosong.contains(lib.inpile[i])) continue;
						if (lib.inpile[i] == 'menghun' || lib.inpile[i] == 'wuxie' || lib.inpile[i] == 'du' || lib.inpile[i] == 'shan') continue;
						var type = get.type(lib.inpile[i]);
						if (type == 'basic' || type == 'trick') {
							if (get.value(game.createCard(lib.inpile[i]), event.target) > 3) {
								console.log(lib.inpile[i]);
								num++;
							}
						}
					}
					if (get.attitude(player, event.player) >= 0 && num >= 2) return true;
					if (get.attitude(player, event.player) < 0 && num <= 1) return true;
					return false;
				},
				prompt2: '令其正面向上交给你一张手牌，然后其从未声明的基本牌和普通锦囊牌中选择一张进行声明并可以视为使用该牌。',
				content: function () {
					'step 0'
					event.target = trigger.player;
					event.target.chooseCard('h', true, get.translation(player) + '发动了【诏颂】；请交给其一张手牌');
					'step 1'
					if (result.bool) {
						var card = result.cards[0];
						event.target.lose(cards, ui.discardPile, 'visible');
						player.gain(card, target, 'give');
						var list = lib.inpile.filter(function (i) {
							if (player.storage.zhaosong.contains(i)) return false;
							if (i == 'menghun' || i == 'wuxie' || i == 'du' || i == 'shan') return false;
							var type = get.type(i);
							if (type == 'basic' || type == 'trick') return true;
							return false;
						});

						for (var i = 0; i < list.length; i++) {
							list[i] = [get.type(list[i]), '', list[i]];
						}
						event.target.chooseButton([get.prompt('zhaosong', trigger.player), [list, 'vcard']]).set('ai', function (button) {
							if (event.target.hp == event.target.maxHp && button.name == 'tao') return false;
							return get.value(game.createCard(button.name), event.target);
						});
					}
					else {
						event.finish();
					}
					'step 2'
					if (result.bool) {
						var name = result.links[0][2];
						event.vcard = result.links;
						event.cardname = name;
						player.storage.zhaosong.add(name);
						player.markSkill('zhaosong');
						event.target.chooseUseTarget({ name: name });
					}
					else {
						event.finish();
					}
				},
				intro: {
					content: function (storage, player, skill) {

						if (player.storage.zhaosong[0]) {
							return "这些牌已经使用过" + '<span class=yellowtext>' + get.translation(player.storage.zhaosong) + '</span>';
						}

						else
							return "没有牌使用过";
					},
				},
				ai: {
					threaten: 1.6,
				}
			},
			lisi: {
				trigger: {
					player: "loseAfter",
					global: ["equipAfter", "addJudgeAfter", "gainAfter", "loseAsyncAfter"],
				},
				locked: true,
				forced: true,
				preHidden: true,
				filter: function (event, player) {
					if (player == _status.currentPhase) return false;
					if (event.name == 'gain' && event.player == player) return false;
					var evt = event.getl(player);
					if (!evt || !evt.hs || !evt.hs.length) return false;
					return true;
				},
				content: function () {
					'step 0'
					var next = player.judge(function (card) {
						if (player.storage.zhaosong.contains(card.name)) return 1;
						return -1;
					});
					next.judge2 = function (result) {
						return result.bool;
					};
					'step 1'
					if (!result.bool || get.position(result.card) != 'd') {
						event.finish();
						return;
					}
					player.turnOver();
					player.storage.zhaosong.remove(result.card.name);
					player.markSkill('zhaosong');
				},
			},

			repojun:{
				shaRelated:true,
				audio:2,
				trigger:{player:'useCardToPlayered'},
				direct:true,
				filter:function(event,player){
					return event.card.name=='sha'&&event.target.hp>0&&event.target.countCards('he')>0;
				},
				content:function(){
					'step 0'
					var next=player.choosePlayerCard(trigger.target,'he',[1,Math.min(trigger.target.hp,trigger.target.countCards('he'))],get.prompt('repojun',trigger.target));
					next.set('ai',function(button){
						if(!_status.event.goon) return 0;
						var val=get.value(button.link);
						if(button.link==_status.event.target.getEquip(2)) return 2*(val+3);
						return val;
					});
					next.set('goon',get.attitude(player,trigger.target)<=0);
					next.set('forceAuto',true);
					'step 1'
					if(result.bool){
						var target=trigger.target;
						player.logSkill('repojun',trigger.target);
						target.addSkill('repojun2');
						target.storage.repojun2.addArray(result.cards);
						target.lose(result.cards,ui.special,'toStorage');
						game.log(target,'失去了'+get.cnNumber(result.cards.length)+'张牌');
						target.markSkill('repojun2');
					}
				},
				ai:{
					unequip_ai:true,
					directHit_ai:true,
					skillTagFilter:function(player,tag,arg){
						if(get.attitude(player,arg.target)>0) return false;
						if(tag=='directHit_ai') return arg.target.hp>=Math.max(1,arg.target.countCards('h')-1);
						if(arg&&arg.name=='sha'&&arg.target.getEquip(2)) return true;
						return false;
					}
				},
				group:'repojun3',
			},
			repojun3:{
				audio:'repojun',
				trigger:{source:'damageBegin1'},
				forced:true,
				locked:false,
				logTarget:'player',
				filter:function(event,player){
					var target=event.player;
					return event.getParent().name=='sha'&&player.countCards('h')>=target.countCards('h')&&player.countCards('e')>=target.countCards('e');
				},
				content:function(){
					trigger.num++;
				},
			},
			repojun2:{
				init:function(player,skill){
					if(!player.storage[skill]) player.storage[skill]=[];
				},
				trigger:{global:'phaseEnd'},
				forced:true,
				popup:false,
				charlotte:true,
				filter:function(event,player){
					return player.storage.repojun2&&player.storage.repojun2.length>0;
				},
				content:function(){
					game.log(player,'收回了'+get.cnNumber(player.gain(player.storage.repojun2,'draw','fromStorage').cards.length)+'张〖破军〗牌');
					player.storage.repojun2.length=0;
					player.removeSkill('repojun2');
				},
				intro:{
					onunmark:'throw',
					content:'cardCount',
				},
			},
		},
		challenge: {
//			fuyoumianmian: function () {
//				if (lib.config.fuyoumianmian.cnt >= 50) {
//					lib.config.fuyoumianmian.finish = true;
//					game.saveConfig('fuyoumianmian', lib.config.fuyoumianmian);
//					game.me.challengeFinish('fuyoumianmian');
//				}
//			},
//			wuxinchengguo: function () {
//
//			},
		},
		characterReplace: {
			zhugeliang: ['young_zhugeliang', 'zhugeliang'],
		},
		translate: {
			fushou: '福寿延绵',
			fushou_info: '将【福寿延绵】放置在判定区中，若判定结果不为黑桃，你卜算两张牌，再摸两张牌。当此牌离开判定区时，将其移出游戏。',

			liubei: '刘备',
			guanyu: '关羽',
			zhangfei: '张飞',
			zhugeliang: '诸葛亮',
			young_zhugeliang: '卧龙诸葛',
			weiyan: '魏延',
			zhaoyun: '赵云',
			jiangwei: '姜维',
			huangyueying: '黄月英',
			ganfuren: '甘夫人',
			wuxian: '吴苋',
			sunquan: '孙权',
			ganning: '甘宁',
			lvmeng: '吕蒙',
			lusu: '鲁肃',
			huanggai: '黄盖',
			zhouyu: '周瑜',
			daqiao: '大乔',
			xiaoqiao: '小乔',
			luxun: '陆逊',
			sunshangxiang: '孙尚香',
			caocao: '曹操',
			xunyou: '荀攸',
			bianfuren: '卞夫人',
			zhonghui: '钟会',
			caiwenji: '蔡文姬',
			xuhuang: '徐晃',
			xiahoudun: '夏侯惇',
			zhangliao: '张辽',
			guojia: '郭嘉',
			zhenji: '甄姬',
			liru: '李儒',
			zhangjiao: '张角',
			huatuo: '华佗',
			lvbu: '吕布',
			gongsunzan: '公孙瓒',
			chengong: '陈宫',
			zuofen: '左棻',

			rende: '仁德',
			jingde: '敬德',
			hanzhi: '汉志',
			jijiang: '激将',

			tuodao: '拖刀',
			tuodao1: '拖刀',
			tuodao2: '拖刀',
			yijue: '义绝',

			paoxiao: '咆哮',
			haoyin: '豪饮',

			longdan: '龙胆',
			longdan2: '龙胆',

			guanxing: '观星',
			kanpo: '看破',
			kongcheng: '空城',
			kongcheng1: '空城',

			mouji: '谋计',
			mouji1: '谋计',
			bazhen: '八阵',

			kuanggu: '狂骨',
			qimou: '奇谋',

			tiaoxin: '挑衅',
			zhiji: '志继',

			jizhi: '集智',
			qicai: '奇才',

			shushen: '淑慎',
			shenzhi: '神智',

			fumian: '福绵',
			fumian1: '福绵',
			daiyan: '怠宴',

			jianxiong: '奸雄',
			hujia: '护驾',

			tuxi: '突袭',

			tiandu: '天妒',
			yiji: '遗计',

			ganglie: '刚烈',

			quanji: '权计',
			zili: '自立',
			paiyi: '排异',
			paiyi_backup: '排异',

			duanliang: '断粮',
			jiezi: '截辎',

			qice: '奇策',
			qice_backup: '奇策',
			zhiyu: '智愚',

			chenqing: '陈情',
			chenqing2: '陈情',
			moshi: '默识',
			moshix: '默识',

			qingguo: '倾国',
			luoshen: '洛神',

			yishi: '宜室',
			yishi1: '宜室',
			yishi2: '宜室',
			yuejian: '约俭',

			zhiheng: '制衡',
			jiuyuan: '救援',

			yingzi: '英姿',
			huoji: '火计',
			fanjian: '反间',
			fanjian_hp: '流失体力',
			fanjian_card: '弃牌',

			kurou: '苦肉',
			zhaxiang: '诈降',

			xiying: '袭营',

			haoshi: '好施',
			haoshi2: '好施',
			dimeng: '缔盟',

			keji: '克己',
			qinxue: '勤学',
			gongxin: '攻心',
			gongxin_discard: '弃置此牌',
			gongxin_top: '置于牌堆顶',

			qianxun: '谦逊',
			qianxun2: '谦逊',
			lianying: '连营',

	//		gongzhi: '弓枝',
	//		gongzhi1: '弓枝',
	//		gongzhi2: '弓枝',
			jianying:'剑影',
			gongzhi: '弓枝',
			xiaoji: '枭姬',

			guose: '国色',
			guose1: '国色',
			yayun: '雅韵',
			shenghua: '生花',

			tianxiang: '天香',
			hongyan: '红颜',
			piaoling: '飘零',

			leiji: '雷击',
			guidao: '鬼道',
			huangtian: '黄天',
			huangtian2: '黄天',

			wushuang: '无双',
			wushuang1: '无双',
			wushuang2: '无双',
			yongzhan: '勇战',

			dumou: '毒谋',
			mieji: '灭计',

			yicong: '义从',
			yicong1: '义从',
			yicong2: '义从',
			yicong3: '义从',

			jijiu: '急救',
			qingnang: '青囊',

			mingce: '明策',
			zhichi: '智迟',
			zhichi2: '智迟',

			zhaosong: '诏颂',
			lisi: '离思',

	//		rende_info: '出牌阶段限一次，你可以将任意张手牌交给一名其他角色。然后该角色获得“敬德”直到你的下个回合开始。',
			rende_info:'出牌阶段限一次，你可以将任意张手牌交给一名其他角色。',
			hanzhi_info:'锁定技，出牌阶段结束时，每满足下列一项，摸一张牌：1.手牌是全场最少的（或之一）；2.体力是全场最少的（或之一）。',
	//		jingde_info: '你因“仁德”获得的牌不计入手牌上限，当你对拥有“仁德”的角色造成伤害时，须正面向上交给其一张牌，否则防止此伤害。',
	//		hanzhi_info: '锁定技，你的回合结束时，若你已受伤，你回复1点体力。若你未受伤，你摸一张牌。',
			jijiang_info: '主公技，当你需要使用或打出【杀】时，你可以令其他蜀势力角色选择是否打出一张【杀】（视为由你使用或打出）。',

			tuodao_info: '你可以将一张红色牌当【杀】延迟使用或打出。你的延时【杀】不可闪避。',
			yijue_info: '每名角色限一次，回合结束时，你可以选择一名角色并选择一项：1.该角色判定区内的【杀】延时效果立即生效；2.该角色回复1点体力，然后你与其各摸一张牌。',

			paoxiao_info: '锁定技，你使用【杀】和【酒】无次数限制。',
			haoyin_info: '你可以将所有锦囊牌（至少一张）当【酒】使用。',

			longdan_info: '你可以将一张【杀】当【闪】、【闪】当【杀】使用或打出。你的回合开始时，若你有手牌且：1.【闪】的数量大于【杀】，你摸X张牌（X为【闪】的数量且最大为3）2.【杀】的数量大于【闪】，本回合你使用的第一张牌无距离限制且可额外指定一个目标。',

			guanxing_info: '准备阶段，你可以卜算X张牌（若存活角色数：不小于4，X为6；小于4，X为4）。',
			kanpo_info: '你可以将一张黑色牌当【无懈可击】使用。',
			kongcheng_info: '锁定技，若你没有基本牌，你展示所有手牌且不能成为【杀】或【决斗】的目标。',

			mouji_info: '出牌阶段开始时，你可以将一张牌名不同的锦囊牌置于武将牌上（【无懈可击】除外），称为“计”，然后摸一张牌。出牌阶段，你可以将一张红色手牌当一张“计”使用，每张“计”每回合只能使用一次。',
			bazhen_info: '锁定技，若你的装备区里没有防具牌，你视为装备着【八卦阵】。',

			kuanggu_info: '当你对距离1以内的一名角色造成1点伤害后，你可以选择一项：1.回复1点体力；2.摸一张牌。',
			qimou_info: '限定技，出牌阶段，你可以失去任意点体力，摸X张牌，然后本回合你计算与其他角色的距离-X且你可以多使用X张【杀】（X为你以此法失去的体力数）。',

			tiaoxin_info: '出牌阶段限一次，你可以选择一名其他角色，然后除非该角色对你使用一张【杀】，否则你弃置其一张牌。',
			zhiji_info: '觉醒技，准备阶段，若你的区域内没有牌，你减1点体力上限并废除一种花色，然后获得“观星”和“汉志”。',

			jizhi_info: '当你使用非转化的普通锦囊牌时，你可以摸一张牌。若此牌是基本牌，你可以弃置此牌，然后本回合手牌上限+1。',
			qicai_info: '锁定技，你使用或延迟使用锦囊牌无距离限制；你延时使用的锦囊牌其延时效果立即生效。',

			shushen_info: '当一名角色回复体力后，你可以令其摸一张牌。',
			shenzhi_info: '其他角色准备阶段开始时，你可以弃置X张手牌（X为该角色的体力值），然后令其回复1点极星体力。',

			fumian_info: '游戏开始时，将【福寿延绵】置入你的判定区。当一名角色判定区内的【福寿延绵】判定生效后，其获得‘福’标记，然后你可以将【福寿延绵】移动到一名没有‘福’标记的角色的判定区中。',
			daiyan_info: '锁定技，结束阶段，若场上不存在【福寿延绵】，将【福寿延绵】置入你的判定区，然后你失去1点体力并移除所有‘福’标记。',

			jianxiong_info: '当你受到伤害后，获得对你造成伤害的牌并摸一张牌。',
			hujia_info: '主公技，当你需要使用或打出【闪】时，你可以令其他魏势力角色选择是否打出一张【闪】（视为由你使用或打出）。',

			tuxi_info: '摸牌阶段，你可以少摸任意张牌并获得等量的其他角色的各一张手牌。',

			tiandu_info: '当你的判定牌生效后，你可以获得此牌。',
			yiji_info: '当你受到1点伤害后，你可以摸两张牌，然后你可以将至多两张手牌交给一至两名其他角色。',

			ganglie_info: '当你受到1点伤害后，你可以进行判定，若结果为：红色，你对伤害来源造成1点伤害；黑色，你弃置其一张牌。',

			quanji_info: '当你受到1点伤害后，可以摸一张牌，然后将一张手牌置于武将牌上，称为“权”；你的手牌上限+X（X为“权”数）。',
			zili_info: '觉醒技，准备阶段，若“权”的数量不小于3，你选择一项：1.回复1点体力；2.摸两张牌。然后减1点体力上限，获得“排异”。',
			paiyi_info: '出牌阶段限一次，你可以移去一张“权”并选择一名角色，令其摸两张牌，然后若其手牌数大于你，你对其造成1伤害。',

			duanliang_info: '出牌阶段，你可以将一张黑色牌当【兵粮寸断】使用。',
			jiezi_info: '每轮限一次，一名角色的判定阶段开始时，你可以摸与其延时牌等量的牌。',

			qice_info: '出牌阶段限一次，你可以将所有手牌当任意一张普通锦囊牌使用，然后你摸一张牌。',
			zhiyu_info: '当你受到1点伤害后，你可以摸一张牌，然后展示所有手牌，若颜色均相同，伤害来源弃置一张手牌。',

			chenqing_info: '每轮限一次，当一名角色进入濒死状态时，你可以令另一名其他角色摸四张牌，然后弃置四张牌。若其以此法弃置的四张牌花色各不相同，则视为该角色对濒死的角色使用一张【桃】。',
			moshi_info: '结束阶段，你可以将一张手牌当你本回合使用过的第一张基本牌或普通锦囊牌使用，然后你可以将一张手牌当你本回合使用过的第二张基本牌或普通锦囊牌使用（你不能通过此技能使用【酒】）。',

			qingguo_info: '你可以将一张黑色牌当【闪】使用或打出。',
			luoshen_info: '准备阶段，你可以进行判定，若结果为黑色，你获得此牌，然后你可以重复此流程。以此法获得的牌本回合不计入手牌上限。',

			yishi_info: '锁定技，游戏开始时，你选择一名角色。除非其死亡，否则你跳过回合并在其出牌阶段结束后依次执行出牌阶段和弃牌阶段。',
			yuejian_info: '每回合限一次，其他角色使用或打出的牌置入弃牌堆时，你可展示所有手牌（至少一张），若你的手牌点数与此牌均不同，你获得此牌。',

			zhiheng_info: '出牌阶段限一次，你可以弃置任意张牌，然后摸等量的牌。若你以此法弃置的牌中包括所有手牌，你多摸一张牌。',
			jiuyuan_info: '主公技，其他吴势力角色于其回合内使用【桃】时，若其体力值大于你，则该角色可以选择令你回复1点体力，然后其摸一张牌。',

			yingzi_info: '锁定技，摸牌阶段，你多摸一张牌；你的手牌上限等于体力上限。',
			huoji_info: '出牌阶段限一次，你可以将一张红桃牌当【火攻】延迟使用。',
			fanjian_info: '出牌阶段限一次，你可以展示一张手牌并交给一名其他角色，其选择一项：1.展示所有手牌，然后弃置与此牌花色相同的所有牌；2.失去1点体力。',

			kurou_info: '出牌阶段，你可以失去1点体力，然后摸两张牌。',
			zhaxiang_info: '限定技，你可以跳过本回合的弃牌阶段。',

			xiying_info: '出牌阶段开始时，你可以跳过出牌阶段，然后选择一项：1.视为使用一张【过河拆桥】，该【过河拆桥】可指定三个目标；2.视为使用一张【趁火打劫】，该【趁火打劫】可指定两个目标。',

			haoshi_info: '摸牌阶段，你可以额外摸两张牌。若此时你的手牌数多于五张，你须将一半(向下取整)的手牌交给场上除你外手牌数最少的一名角色。',
			dimeng_info: '出牌阶段限一次，你可以令两名手牌数的差不大于你的牌数的其他角色交换手牌。若如此做，此阶段结束时，你弃置X张牌（X为这两名角色手牌数的差）。',

			keji_info: '弃牌阶段开始时，若你未于出牌阶段内使用或打出过【杀】，你可以摸两张牌或跳过弃牌阶段。',
			qinxue_info: '觉醒技，准备阶段，若你的手牌数比你的体力值多3或更多（若游戏人数不小于7则改为2），你减1点体力上限，然后获得“攻心”和“英姿”。',
			gongxin_info: '出牌阶段限一次，你可以观看一名其他角色的手牌，然后你可以展示其中一张红桃牌，选择一项：1.弃置此牌；2.将此牌置于牌堆顶。',

			qianxun_info: '当一张延时锦囊牌或其他角色使用的普通锦囊牌生效时，若你是此牌的唯一目标，你可以将所有手牌扣置于武将牌上，若如此做，此回合结束时，你获得武将牌上的所有牌。',
			lianying_info: '当你失去手牌后，若你没有手牌，你可以令至多X名角色各摸一张牌（X为你此次失去的手牌数）。',

			jianying_info:'出牌阶段限一次，你可以将一张装备牌当无距离限制的【杀】使用。',
			gongzhi_info:'锁定技，当你使用【杀】指定目标后，若目标角色在你的攻击范围外，其不能使用【闪】闪避此【杀】。',
	//		gongzhi_info: '锁定技，你的回合内使用的第一张【杀】无距离限制，第二张【杀】伤害+1，第三张【杀】不可闪避。当你使用的【杀】被目标角色使用的【闪】抵消时，你可以对其使用【杀】（无距离限制）。',
			xiaoji_info: '锁定技，当你失去装备区里的牌后，你摸两张牌。',

			guose_info: '出牌阶段限一次，你可以将一张方片牌当做【乐不思蜀】使用。当一名角色的判定牌生效前，你可以打出一张方片牌替换之。',
			yayun_info: '锁定技，你的梅花牌花色视为方片。',
			shenghua_info: '每回合限一次，当一名角色的判定牌为红色时，你可以令其回复1点极星体力或摸一张牌。',

			tianxiang_info: '当你受到伤害时，你可以弃置一张红桃牌，防止此伤害并选择一名其他角色，若如此做，你选择一项：1.令其受到伤害来源对其造成的1点伤害，然后摸X张牌（X为其已损失体力值且至多为5）；2.令其失去1点体力，然后其获得你弃置的牌。',
			hongyan_info: '锁定技，你的黑桃牌花色视为红桃。',
			piaoling_info: '回合结束时，你可进行判定，若结果为红桃，你将判定牌置于牌堆顶或交给一名角色，若该角色是你，你弃置一张牌。',

			leiji_info: '当你使用或打出【闪】时，你可以令一名其他角色进行判定，若结果为：黑桃，你对其造成2点雷电伤害；梅花，你回复1点体力，然后对其造成1点雷电伤害。',
			guidao_info: '每回合限一次，当一名角色的判定牌生效前，你可以打出一张黑色牌替换之。',
			huangtian_info: '主公技，其他群势力角色的出牌阶段限一次，该角色可以将一张【闪】或【闪电】交给你。',

			wushuang_info: '锁定技，你使用【杀】的目标须两张【闪】才可以闪避；与你决斗的角色每次须打出两张【杀】。',
			yongzhan_info: '限定技，你将武将牌翻面并选择至多三名角色，然后分别对其使用【决斗】。',

			dumou_info: '锁定技，在你的回合内，其他角色的黑色牌均视为【毒】。你的【毒】视为【过河拆桥】。',
			mieji_info: '出牌阶段限一次，你可以将一张黑色牌置于牌堆顶，然后令一名有手牌的其他角色选择一项：1.弃置一张锦囊牌；2.依次弃置两张非锦囊牌（不足则弃置一张）。',

			yicong_info: '锁定技，你的回合开始时，你废除一个装备栏，摸两张牌，并且选择一项：1.你计算与其他角色的距离-1（最多选2次）；2.其他角色计算与你的距离+1（最多选2次）。若你已经废除所有装备栏，你的武器牌视为【杀】、防具牌视为【闪】、坐骑牌视为【酒】、宝物牌视为【桃】。',

			jijiu_info: '你于回合外可以将一张红色牌当【桃】使用。',
			qingnang_info: '出牌阶段限一次，你可以将一张牌当做【刮骨疗毒】使用或延迟使用。',

			mingce_info: '出牌阶段限一次，你可以将一张牌赠予一名其他角色，然后其选择一项：1.使用一张牌；2.摸一张牌。',
			zhichi_info: '锁定技，当你于回合外受到伤害后，本回合【杀】和普通锦囊牌对你无效。',

			zhaosong_info: '一名其他角色的摸牌阶段结束后，你可令其正面向上将一张手牌交给你，然后其从未声明的基本牌和普通锦囊牌中选择一张进行声明并可以视为使用该牌。',
			lisi_info: '锁定技，当你在回合外失去手牌时，你进行一次判定，若该判定牌已经声明，你将武将牌翻面，然后其变为未声明状态。',

			dabao:'界徐盛',
			dabao_happy:'快乐的大宝',
			repojun:'破军',
			repojun2:'破军',
			repojun3:'破军',
			repojun_info:'当你使用【杀】指定一个目标后，你可以将其至多X张牌扣置于该角色的武将牌旁（X为其体力值）；若如此做，当前回合结束后，该角色获得这些牌。你使用【杀】对手牌数与装备数均不大于你的角色造成伤害时，此伤害+1。',

			standard_shu: "标准包蜀",
			standard_wei: "标准包魏",
			standard_wu: "标准包吴",
			standard_qun: "标准包群",
			standard_jin: "标准包晋",
			standard_funny:"整活",

		},
	};
});
